Skip to content

Commit 6fc12b0

Browse files
author
Richard Jones
committed
backporting changes from HEAD
1 parent 0efd2ae commit 6fc12b0

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ are given with the most recent entry first.
1010
- fixed roundup-reminder (sf bug 681042)
1111
- fixed int assumptions about Number values (sf bug 677762)
1212
- clarified licensing
13+
- another attempt to fix cookie misbehaviour - customise cookie name using
14+
tracker name
15+
- fixed error in indexargs_url (thanks Patrick Ohly)
1316

1417

1518
2003-01-24 0.5.5

roundup/cgi/client.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.65.2.3 2003-02-06 05:44:49 richard Exp $
1+
# $Id: client.py,v 1.65.2.4 2003-02-08 23:03:36 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -95,6 +95,8 @@ def __init__(self, instance, request, env, form=None):
9595
# this is the "cookie path" for this tracker (ie. the path part of
9696
# the "base" url)
9797
self.cookie_path = urlparse.urlparse(self.base)[2]
98+
self.cookie_name = 'roundup_session_' + re.sub('[^a-zA-Z]', '',
99+
self.instance.config.TRACKER_NAME)
98100

99101
# see if we need to re-parse the environment for the form (eg Zope)
100102
if form is None:
@@ -217,11 +219,11 @@ def determine_user(self):
217219
user = 'anonymous'
218220

219221
# bump the "revision" of the cookie since the format changed
220-
if (cookie.has_key('roundup_user_2') and
221-
cookie['roundup_user_2'].value != 'deleted'):
222+
if (cookie.has_key(self.cookie_name) and
223+
cookie[self.cookie_name].value != 'deleted'):
222224

223225
# get the session key from the cookie
224-
self.session = cookie['roundup_user_2'].value
226+
self.session = cookie[self.cookie_name].value
225227
# get the user from the session
226228
try:
227229
# update the lifetime datestamp
@@ -475,8 +477,8 @@ def set_cookie(self, user):
475477

476478
# generate the cookie path - make sure it has a trailing '/'
477479
self.additional_headers['Set-Cookie'] = \
478-
'roundup_user_2=%s; expires=%s; Path=%s;'%(self.session, expire,
479-
self.cookie_path)
480+
'%s=%s; expires=%s; Path=%s;'%(self.cookie_name, self.session,
481+
expire, self.cookie_path)
480482

481483
def make_user_anonymous(self):
482484
''' Make us anonymous
@@ -572,8 +574,8 @@ def logout_action(self):
572574
# construct the logout cookie
573575
now = Cookie._getdate()
574576
self.additional_headers['Set-Cookie'] = \
575-
'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now,
576-
self.cookie_path)
577+
'%s=deleted; Max-Age=0; expires=%s; Path=%s;'%(self.cookie_name,
578+
now, self.cookie_path)
577579

578580
# Let the user know what's going on
579581
self.ok_message.append(_('You are logged out'))

roundup/cgi/templating.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,7 @@ def indexargs_url(self, url, args):
14911491
else:
14921492
val = self.group[1]
14931493
l.append(':group=%s'%val)
1494-
if self.filter and not args.has_key(':columns'):
1494+
if self.filter and not args.has_key(':filter'):
14951495
l.append(':filter=%s'%(','.join(self.filter)))
14961496
for k,v in self.filterspec.items():
14971497
if not args.has_key(k):

0 commit comments

Comments
 (0)