2005-11-23 18:34:20 +01:00
|
|
|
import database
|
|
|
|
|
2005-12-14 19:04:38 +01:00
|
|
|
from cherrypy import cpg
|
|
|
|
from cherrypy.lib import httptools
|
2005-11-23 18:34:20 +01:00
|
|
|
|
2005-12-14 19:04:38 +01:00
|
|
|
|
|
|
|
class Logout:
|
|
|
|
def index(self):
|
|
|
|
try:
|
|
|
|
username = cpg.request.sessionMap["username"]
|
|
|
|
myuser = database.Users.byUsername(username)
|
|
|
|
myuser.sessionid = None
|
|
|
|
myuser.timeout = 0
|
|
|
|
except:
|
|
|
|
return helper.cs_render("templates/not_logged_in.cs")
|
|
|
|
username = ""
|
|
|
|
#sessionid = cpg.request.sessionMap["_sessionId"]
|
|
|
|
# now let cookie expire
|
|
|
|
cpg.response.simpleCookie["WebGoSessionCookie"]["expires"] = 0
|
|
|
|
httptools.redirect("/")
|
|
|
|
index.exposed = True
|