Esempio n. 1
0
def getAcessingUser():
    if (not 'auth' in cherrypy.request.cookie) or cherrypy.request.cookie['auth'].value not in auth.Tokens:
       return "<unknown>"
    return auth.whoHasToken(cherrypy.request.cookie['auth'].value)
Esempio n. 2
0
 def logout(self,**kwargs):
     #Change the securit token to make the old one invalid and thus log user out.
     if cherrypy.request.cookie['auth'].value in auth.Tokens:
         auth.assignNewToken(auth.whoHasToken(cherrypy.request.cookie['auth'].value))
     raise cherrypy.HTTPRedirect("/")