Skip to content

Commit 53defdb

Browse files
author
Derrick Hudson
committed
Fixed the logic for determing the cookie path. (Closes [SF#562130].)
1 parent 8b8d2a3 commit 53defdb

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

frontends/ZRoundup/ZRoundup.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
17-
# $Id: ZRoundup.py,v 1.5 2002-05-14 23:36:25 richard Exp $
17+
# $Id: ZRoundup.py,v 1.6 2002-06-12 00:59:44 dman13 Exp $
1818
#
1919
''' ZRoundup module - exposes the roundup web interface to Zope
2020
@@ -123,8 +123,23 @@ def _opendb(self):
123123
instance = roundup.instance.open(self.instance_home)
124124
request = RequestWrapper(self.REQUEST['RESPONSE'])
125125
env = self.REQUEST.environ
126-
env['SCRIPT_NAME'] = '/'.join(self.getPhysicalPath()[:-1])
127-
env['INSTANCE_NAME'] = self.id
126+
127+
# figure out the path components to set
128+
import urlparse
129+
path = urlparse.urlparse( self.absolute_url() )[2]
130+
path_components = path.split( '/' )
131+
132+
# special case when roundup is '/' in this virtual host,
133+
if path == "/" :
134+
env['SCRIPT_NAME'] = "/"
135+
env['INSTANCE_NAME'] = ''
136+
else :
137+
# all but the last element is the path
138+
env['SCRIPT_NAME'] = '/'.join( path_components[:-1] )
139+
# the last element is the name
140+
env['INSTANCE_NAME'] = path_components[-1]
141+
del path_components , path
142+
128143
if env['REQUEST_METHOD'] == 'GET':
129144
# force roundup to re-parse the request because Zope fiddles
130145
# with it and we lose all the :filter, :columns, etc goodness
@@ -169,6 +184,10 @@ def __getitem__(self, item):
169184

170185
#
171186
# $Log: not supported by cvs2svn $
187+
# Revision 1.5 2002/05/14 23:36:25 richard
188+
# . fixed SCRIPT_NAME in ZRoundup for instances not at top level of Zope
189+
# (thanks dman)
190+
#
172191
# Revision 1.4 2002/01/10 03:38:16 richard
173192
# reformatting for 80 cols
174193
#

0 commit comments

Comments
 (0)