summaryrefslogtreecommitdiffstats
path: root/ipsilon/util/user.py
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-06-18 00:04:08 -0400
committerPatrick Uiterwijk <puiterwijk@redhat.com>2014-08-27 16:31:57 -0400
commit34bb81a826d023ce39714e1a6e027b19cf96a5fd (patch)
treec70e17feb7838c8996ee98949d526a552547dfb1 /ipsilon/util/user.py
parentfca4035996c93f8f05ea3837133961e28a1248d6 (diff)
downloadipsilon-34bb81a826d023ce39714e1a6e027b19cf96a5fd.tar.gz
ipsilon-34bb81a826d023ce39714e1a6e027b19cf96a5fd.tar.xz
ipsilon-34bb81a826d023ce39714e1a6e027b19cf96a5fd.zip
Rework remote_login and remove protect decorator
The protect decorator was not really being used for anything, remove it. Change the way UserSession's remote_login() works. If called now it either sets a REMOTE_USER (if found) or nukes the current user data in the session. This means this function can be safely called only in a login plugin now. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'ipsilon/util/user.py')
-rwxr-xr-xipsilon/util/user.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ipsilon/util/user.py b/ipsilon/util/user.py
index f47c072..7c53526 100755
--- a/ipsilon/util/user.py
+++ b/ipsilon/util/user.py
@@ -111,7 +111,9 @@ class UserSession(object):
def remote_login(self):
if cherrypy.request.login:
- return self.login(cherrypy.request.login)
+ self.login(cherrypy.request.login)
+ else:
+ self.nuke_data('user')
def login(self, username):
if self.user == username:
@@ -120,8 +122,9 @@ class UserSession(object):
# REMOTE_USER changed, replace user
self.nuke_data('user')
self.save_data('user', 'name', username)
+ self.user = username
- cherrypy.log('LOGIN SUCCESSFUL: %s', username)
+ cherrypy.log('LOGIN SUCCESSFUL: %s' % username)
def logout(self, user):
if user is not None: