Skip to content

Commit

Permalink
implementing logout
Browse files Browse the repository at this point in the history
  • Loading branch information
kakwa committed May 27, 2015
1 parent 0ae2343 commit 3bb36d1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ldapcherry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,14 @@ def login(self, login, password):
def logout(self):
""" logout page
"""
user = self.auth.end_session()
sess = cherrypy.session
username = sess.get(SESSION_KEY, None)
sess[SESSION_KEY] = None
if username:
cherrypy.request.login = None

message = "user '%(user)s' logout" % {
'user': user
'user': username
}
cherrypy.log.error(
msg = message,
Expand Down

0 comments on commit 3bb36d1

Please sign in to comment.