- add logging to login method
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@190 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
parent
68431035d0
commit
572b42a706
1 changed files with 6 additions and 0 deletions
|
@ -35,6 +35,9 @@ class Session:
|
||||||
return self._timeoutTimer
|
return self._timeoutTimer
|
||||||
|
|
||||||
class SessionManager:
|
class SessionManager:
|
||||||
|
"""
|
||||||
|
The Sessionmanager provides methods for login and session handling.
|
||||||
|
"""
|
||||||
def __init__(self, dbconn):
|
def __init__(self, dbconn):
|
||||||
self._sessions = {}
|
self._sessions = {}
|
||||||
self._dbconn = dbconn
|
self._dbconn = dbconn
|
||||||
|
@ -56,7 +59,10 @@ class SessionManager:
|
||||||
sessionid = self._hashobj.hexdigest()
|
sessionid = self._hashobj.hexdigest()
|
||||||
self._sessions[sessionid] = Session(sessionid, login)
|
self._sessions[sessionid] = Session(sessionid, login)
|
||||||
self.updateSession(sessionid)
|
self.updateSession(sessionid)
|
||||||
|
self.logger.info('New session with id %s created for %s' %
|
||||||
|
(sessionid, login))
|
||||||
return sessionid
|
return sessionid
|
||||||
|
self.logger.info('Login for %s failed' % login)
|
||||||
raise InvalidLoginError
|
raise InvalidLoginError
|
||||||
|
|
||||||
def updateSession(self, sessionid):
|
def updateSession(self, sessionid):
|
||||||
|
|
Loading…
Reference in a new issue