fixed auth.impersonating again, thanks Ricardo

This commit is contained in:
Massimo committed 2012-10-16 11:08:42 -05:00
1 parent 418e753684
commit fd0f48f028
2 files changed
+6 -5

No files matched your search

+1 -1
View File
@@ -1 +1 @@
Version 2.1.1 (2012-10-16 10:54:30) dev Version 2.1.1 (2012-10-16 11:08:39) dev
+5 -4
View File
@@ -2746,10 +2746,11 @@ class Auth(object):
callback(form) callback(form)
log = self.messages.impersonate_log log = self.messages.impersonate_log
self.log_event(log,dict(id=current_id, other_id=auth.user.id)) self.log_event(log,dict(id=current_id, other_id=auth.user.id))
elif user_id in (0, '0') and self.is_impersonating(): elif user_id in (0, '0'):
session.clear() if self.is_impersonating():
session.update(cPickle.loads(auth.impersonator)) session.clear()
self.user = session.auth.user session.update(cPickle.loads(auth.impersonator))
self.user = session.auth.user
return None return None
if requested_id is DEFAULT and not request.post_vars: if requested_id is DEFAULT and not request.post_vars:
return SQLFORM.factory(Field('user_id', 'integer')) return SQLFORM.factory(Field('user_id', 'integer'))