From 3bb36d1a7453f77d760cc7646410a630e8272633 Mon Sep 17 00:00:00 2001 From: kakwa Date: Thu, 28 May 2015 01:23:22 +0200 Subject: [PATCH] implementing logout --- ldapcherry/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ldapcherry/__init__.py b/ldapcherry/__init__.py index 6ba7946..a104048 100644 --- a/ldapcherry/__init__.py +++ b/ldapcherry/__init__.py @@ -414,9 +414,14 @@ class LdapCherry(object): 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,