Roundup Tracker - Issues

Issue 562130

classification
zroundup generates wrong paths with VHM
Type: Severity: normal
Components: Web interface Versions:
process
Status: closed fixed
:
: dman13 : dman13
Priority: normal :

Created on 2002-05-29 22:57 by anonymous, last changed 2002-06-12 01:15 by dman13.

Messages
msg238 Author: [hidden] (anonymous) Date: 2002-05-29 22:57
If a Virtual Host Monster is used, the URL to access
the ZRoundup instance is not it's physical path.  This
patch (against cvs) corrects the behavior :


Index: frontends/ZRoundup/ZRoundup.py
===================================================================
RCS file:
/cvsroot/roundup/roundup/frontends/ZRoundup/ZRoundup.py,v
retrieving revision 1.5
diff -U3 -r1.5 ZRoundup.py
--- frontends/ZRoundup/ZRoundup.py	14 May 2002 23:36:25 -0000	1.5
+++ frontends/ZRoundup/ZRoundup.py	29 May 2002 22:52:33 -0000
@@ -123,8 +123,20 @@
         instance =
roundup.instance.open(self.instance_home)
         request = RequestWrapper(self.REQUEST['RESPONSE'])
         env = self.REQUEST.environ
-        env['SCRIPT_NAME'] =
'/'.join(self.getPhysicalPath()[:-1])
-        env['INSTANCE_NAME'] = self.id
+
+        # figure out the path components to set 
+        # First step: strip off the proto and host
+        path_components = self.absolute_url().split(
'/' )[3:]
+        # special case when roundup is '/' in this
virtual host,
+        if len( path_components ) < 1 :
+            env['SCRIPT_NAME'] = env['INSTANCE_NAME'] = ''
+        else :
+            # all but the last element is the path
+            env['SCRIPT_NAME'] = '/'.join(
path_components[:-1] )
+            # the last element is the name
+            env['INSTANCE_NAME'] = path_components[-1]
+        del path_components
+
         if env['REQUEST_METHOD'] == 'GET':
             # force roundup to re-parse the request
because Zope fiddles
             # with it and we lose all the :filter,
:columns, etc goodness
msg239 Author: [hidden] (dman13) Date: 2002-06-11 01:29
Logged In: YES 
user_id=555791

The previous patch is wrong.  It omits the leading '/' from
the cookie path.  I have a new patch that works, but hasn't
been tested with roundup as the root object with a VHM.

(I don't see any "attach file" option on this form.  How can
I attach a file to an existing bug?)
msg240 Author: [hidden] (dman13) Date: 2002-06-12 01:15
Logged In: YES 
user_id=555791

I fixed this now.
History
Date User Action Args
2002-05-29 22:57:12anonymouscreate