Define a smaller cookie age and protect against deleted users.

see #307
This commit is contained in:
Antoine Nguyen
2013-01-17 22:36:49 +01:00
parent e5d293fb6e
commit fa9db46bfe
2 changed files with 8 additions and 1 deletions
+2
View File
@@ -159,6 +159,8 @@ 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.
+6 -1
View File
@@ -193,7 +193,12 @@ class ConnectedUsers(template.Node):
uid_list.append(uid)
# Query all logged in users based on id list
context[self.varname] = [User.objects.get(pk=uid) for uid in uid_list]
context[self.varname] = []
for uid in uid_list:
try:
context[self.varname].append(User.objects.get(pk=uid))
except User.DoesNotExist:
print "unknown user"
return ''
@register.tag