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