Example #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)
Example #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("/")