Show More
@@ -70,6 +70,11 b' class LoginController(BaseController):' | |||||
70 | auth_user.set_authenticated() |
|
70 | auth_user.set_authenticated() | |
71 | cs = auth_user.get_cookie_store() |
|
71 | cs = auth_user.get_cookie_store() | |
72 | session['rhodecode_user'] = cs |
|
72 | session['rhodecode_user'] = cs | |
|
73 | # If they want to be remembered, update the cookie | |||
|
74 | if c.form_result['remember'] is not False: | |||
|
75 | session.cookie_expires = False | |||
|
76 | session._set_cookie_values() | |||
|
77 | session._update_cookie_out() | |||
73 | session.save() |
|
78 | session.save() | |
74 |
|
79 | |||
75 | log.info('user %s is now authenticated and stored in ' |
|
80 | log.info('user %s is now authenticated and stored in ' | |
@@ -159,7 +164,6 b' class LoginController(BaseController):' | |||||
159 | return redirect(url('login_home')) |
|
164 | return redirect(url('login_home')) | |
160 |
|
165 | |||
161 | def logout(self): |
|
166 | def logout(self): | |
162 |
|
|
167 | session.delete() | |
163 | session.save() |
|
168 | log.info('Logging out and deleting session for user') | |
164 | log.info('Logging out and setting user as Empty') |
|
|||
165 | redirect(url('home')) |
|
169 | redirect(url('home')) |
@@ -482,6 +482,8 b' class LoginForm(formencode.Schema):' | |||||
482 | 'tooShort':_('Enter %(min)i characters or more')} |
|
482 | 'tooShort':_('Enter %(min)i characters or more')} | |
483 | ) |
|
483 | ) | |
484 |
|
484 | |||
|
485 | remember = StringBoolean(if_missing=False) | |||
|
486 | ||||
485 | chained_validators = [ValidAuth] |
|
487 | chained_validators = [ValidAuth] | |
486 |
|
488 | |||
487 | def UserForm(edit=False, old_data={}): |
|
489 | def UserForm(edit=False, old_data={}): |
@@ -44,12 +44,12 b'' | |||||
44 | </div> |
|
44 | </div> | |
45 |
|
45 | |||
46 | </div> |
|
46 | </div> | |
47 |
|
|
47 | <div class="field"> | |
48 |
|
|
48 | <div class="checkbox"> | |
49 |
|
|
49 | <input type="checkbox" id="remember" name="remember" /> | |
50 |
|
|
50 | <label for="remember">Remember me</label> | |
51 |
|
|
51 | </div> | |
52 |
|
|
52 | </div> | |
53 | <div class="buttons"> |
|
53 | <div class="buttons"> | |
54 | ${h.submit('sign_in',_('Sign In'),class_="ui-button")} |
|
54 | ${h.submit('sign_in',_('Sign In'),class_="ui-button")} | |
55 | </div> |
|
55 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now