Ensure the 'Remember me' feature works with fresh installs.

This commit is contained in:
Antoine Nguyen
2013-06-20 10:11:11 +02:00
parent 5dd23e51ed
commit c2a0304038
3 changed files with 3 additions and 10 deletions
+2 -7
View File
@@ -147,14 +147,9 @@ Few parameters need to be set in the *settings.py* configuration
file to make Modoboa behave as expected::
SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Default value
SESSION_COOKIE_AGE = 600 # time in seconds
The first parameter is optional but you must ensure it is set to
``False`` (the default value).
The second one tells Django that a session inactive for this time
should be considered as closed. You are free to adjust it according to
your need.
This parameter is optional but you must ensure it is set to ``False``
(the default value).
The default configuration file provided by the *modoboa-admin.py*
command is properly configured.
+1 -1
View File
@@ -20,9 +20,9 @@ def dologin(request):
user = authenticate(username=form.cleaned_data["username"],
password=form.cleaned_data["password"])
if user and user.is_active:
login(request, user)
if not form.cleaned_data["rememberme"]:
request.session.set_expiry(0)
login(request, user)
if request.user.has_mailbox:
request.session["password"] = encrypt(form.cleaned_data["password"])
-2
View File
@@ -179,8 +179,6 @@ AUTHENTICATION_BACKENDS = (
'modoboa.lib.authbackends.SimpleBackend',
)
SESSION_COOKIE_AGE = 600
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.