diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index d96aa168258a13532244194fd88ef6eabc16a394..03cfa642eab575652f69200029b2a043a61ddd21 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $Id: client.py,v 1.165 2004-02-25 23:27:54 richard Exp $
+# $Id: client.py,v 1.166 2004-03-18 01:58:46 richard Exp $
"""WWW request handler (also used in the stand-alone server).
"""
Note: also cleans One Time Keys, and other "session" based stuff.
"""
- sessions = self.db.sessions
- last_clean = self.db.sessions.get('last_clean', 'last_use') or 0
+ sessions = self.db.getSessionManager()
+ last_clean = sessions.get('last_clean', 'last_use', 0)
# time to clean?
week = 60*60*24*7
if now - last_clean < hour:
return
- self.db.sessions.clean(now)
- self.db.otks.clean(now)
- self.db.sessions.set('last_clean', last_use=time.time())
+ sessions.clean(now)
+ self.db.getOTKManager().clean(now)
+ sessions.set('last_clean', last_use=time.time())
+ self.db.commit()
def determine_user(self):
''' Determine who the user is
# make sure we have the session Class
self.clean_sessions()
- sessions = self.db.sessions
+ sessions = self.db.getSessionManager()
# first up, try the REMOTE_USER var (from HTTP Basic Auth handled
# by a front-end HTTP server)
try:
# update the lifetime datestamp
sessions.updateTimestamp(self.session)
- sessions.commit()
user = sessions.get(self.session, 'user')
except KeyError:
# not valid, ignore id
self.session = self.session[:-1]
# insert the session in the sessiondb
- self.db.sessions.set(self.session, user=user, last_use=time.time())
-
- # and commit immediately
- self.db.sessions.commit()
+ sessions = self.db.getSessionManager()
+ sessions.set(self.session, user=user)
+ self.db.commit()
# expire us in a long, long time
expire = Cookie._getdate(86400*365)