Skip to content

Commit 181ee96

Browse files
author
Richard Jones
committed
removed debugging
1 parent 4579f26 commit 181ee96

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

roundup/cgi_client.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.136 2002-07-10 06:51:08 richard Exp $
18+
# $Id: cgi_client.py,v 1.137 2002-07-10 07:00:30 richard Exp $
1919

2020
__doc__ = """
2121
WWW request handler (also used in the stand-alone server).
@@ -44,6 +44,9 @@ class Client:
4444
'anonymous' user exists, the user is logged in using that user (though
4545
there is no cookie). This allows them to modify the database, and all
4646
modifications are attributed to the 'anonymous' user.
47+
48+
Once a user logs in, they are assigned a session. The Client instance
49+
keeps the nodeid of the session as the "session" attribute.
4750
'''
4851

4952
def __init__(self, instance, request, env, form=None):
@@ -1164,7 +1167,8 @@ def set_cookie(self, user, password):
11641167
print 'session set to', `session`
11651168

11661169
# insert the session in the sessiondb
1167-
self.db.getclass('__sessions').create(sessid=session, user=user,
1170+
sessions = self.db.getclass('__sessions')
1171+
self.session = sessions.create(sessid=session, user=user,
11681172
last_use=date.Date())
11691173

11701174
# and commit immediately
@@ -1239,19 +1243,17 @@ def main(self):
12391243
user = 'anonymous'
12401244
if (cookie.has_key('roundup_user') and
12411245
cookie['roundup_user'].value != 'deleted'):
1242-
print cookie
12431246

12441247
# get the session key from the cookie
12451248
session = cookie['roundup_user'].value
1246-
print 'session is', `session`
12471249

12481250
# get the user from the session
12491251
try:
1250-
sessid = sessions.lookup(session)
1252+
self.session = sessions.lookup(session)
12511253
except KeyError:
12521254
user = 'anonymous'
12531255
else:
1254-
sessions.set(sessid, last_use=date.Date())
1256+
sessions.set(self.session, last_use=date.Date())
12551257
self.db.commit()
12561258
user = sessions.get(sessid, 'user')
12571259

@@ -1494,6 +1496,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')):
14941496

14951497
#
14961498
# $Log: not supported by cvs2svn $
1499+
# Revision 1.136 2002/07/10 06:51:08 richard
1500+
# . #576241 ] MultiLink problems in parsePropsFromForm
1501+
#
14971502
# Revision 1.135 2002/07/10 00:22:34 richard
14981503
# . switched to using a session-based web login
14991504
#

0 commit comments

Comments
 (0)