Commit ed2894eb authored by Jim Fulton's avatar Jim Fulton

Modified BASEx to properly handle sites that server only Principia objects.

parent 037acbd3
...@@ -373,7 +373,7 @@ Publishing a module using CGI ...@@ -373,7 +373,7 @@ Publishing a module using CGI
containing the module to be published) to the module name in the containing the module to be published) to the module name in the
cgi-bin directory. cgi-bin directory.
$Id: Publish.py,v 1.84 1998/04/15 12:01:56 jim Exp $""" $Id: Publish.py,v 1.85 1998/04/20 16:24:52 jim Exp $"""
#' #'
# Copyright # Copyright
# #
...@@ -428,7 +428,7 @@ $Id: Publish.py,v 1.84 1998/04/15 12:01:56 jim Exp $""" ...@@ -428,7 +428,7 @@ $Id: Publish.py,v 1.84 1998/04/15 12:01:56 jim Exp $"""
# See end of file for change log. # See end of file for change log.
# #
########################################################################## ##########################################################################
__version__='$Revision: 1.84 $'[11:-2] __version__='$Revision: 1.85 $'[11:-2]
import sys, os, string, cgi, regex import sys, os, string, cgi, regex
from string import * from string import *
...@@ -738,7 +738,8 @@ class ModulePublisher: ...@@ -738,7 +738,8 @@ class ModulePublisher:
if entry_name != method and method != 'index_html': if entry_name != method and method != 'index_html':
self.notFoundError(method) self.notFoundError(method)
request.steps=steps
parents.reverse() parents.reverse()
# Do authorization checks # Do authorization checks
...@@ -1218,17 +1219,15 @@ class Request: ...@@ -1218,17 +1219,15 @@ class Request:
if key[:1]=='B' and BASEmatch(key) >= 0 and other.has_key('URL'): if key[:1]=='B' and BASEmatch(key) >= 0 and other.has_key('URL'):
n=ord(key[4])-ord('0') n=ord(key[4])-ord('0')
URL=other['URL'] if n:
baselen=len(self.base) v=self.script
for i in range(0,n): while v[-1:]=='/': v=v[:-1]
baselen=find(URL,'/',baselen+1) v=join([v]+self.steps[:n-1],'/')
if baselen < 0: else:
baselen=len(URL) v=self.base
break while v[-1:]=='/': v=v[:-1]
base=URL[:baselen] other[key]=v
if base[-1:]=='/': base=base[:-1] return v
other[key]=base
return base
if default is not field2list: return default if default is not field2list: return default
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment