mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Define a smaller cookie age and protect against deleted users.
see #307
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user