merged some code form issue 1534 Session ID not changed after privilege level change, thanks kablubr

This commit is contained in:
mdipierro
2013-06-16 07:20:54 -05:00
parent 9b9e64e9ef
commit d04f2ff502
3 changed files with 111 additions and 1 deletions
+6
View File
@@ -920,6 +920,8 @@ class Auth(object):
update_fields = ['email'],
ondelete="CASCADE",
client_side = True,
keep_session_onlogin=True,
keep_session_onlogout=False,
wiki = Settings(),
)
# ## these are messages that can be customized
@@ -1850,6 +1852,8 @@ class Auth(object):
for key,value in user.items():
if callable(value) or key=='password':
delattr(user,key)
current.session.renew(
clear_session=not self.settings.keep_session_onlogin, db=self.db)
current.session.auth = Storage(
user = user,
last_visit=current.request.now,
@@ -2236,6 +2240,8 @@ class Auth(object):
current.session.auth = None
current.session.flash = self.messages.logged_out
current.session.renew(
clear_session=not self.settings.keep_session_onlogout, db=self.db)
if not next is None:
redirect(next)