Commit ee0e601c authored by Jim Fulton's avatar Jim Fulton

Added machinery to compute AUTHENTICATION_PATH, which is used, with

AUTHENTICATED_USER to label transactions.
parent 26b29ceb
...@@ -491,7 +491,7 @@ Publishing a module using Fast CGI ...@@ -491,7 +491,7 @@ Publishing a module using Fast CGI
o Configure the Fast CGI-enabled web server to execute this o Configure the Fast CGI-enabled web server to execute this
file. file.
$Id: Publish.py,v 1.52 1997/09/11 21:27:45 jim Exp $""" $Id: Publish.py,v 1.53 1997/09/23 10:32:57 jim Exp $"""
#' #'
# Copyright # Copyright
# #
...@@ -546,7 +546,7 @@ $Id: Publish.py,v 1.52 1997/09/11 21:27:45 jim Exp $""" ...@@ -546,7 +546,7 @@ $Id: Publish.py,v 1.52 1997/09/11 21:27:45 jim Exp $"""
# See end of file for change log. # See end of file for change log.
# #
########################################################################## ##########################################################################
__version__='$Revision: 1.52 $'[11:-2] __version__='$Revision: 1.53 $'[11:-2]
def main(): def main():
...@@ -841,7 +841,8 @@ class ModulePublisher: ...@@ -841,7 +841,8 @@ class ModulePublisher:
try: # Try to bind the top-level object to the request try: # Try to bind the top-level object to the request
object=object.__of__(RequestContainer(REQUEST=self.request)) object=object.__of__(RequestContainer(REQUEST=self.request))
except: pass except: pass
steps=[]
while path: while path:
entry_name,path=path[0], path[1:] entry_name,path=path[0], path[1:]
URL="%s/%s" % (URL,quote(entry_name)) URL="%s/%s" % (URL,quote(entry_name))
...@@ -881,6 +882,8 @@ class ModulePublisher: ...@@ -881,6 +882,8 @@ class ModulePublisher:
# Promote subobject to object # Promote subobject to object
parents.append(object) parents.append(object)
object=subobject object=subobject
steps.append(entry_name)
# Check for method: # Check for method:
if (not path and hasattr(object,method) and if (not path and hasattr(object,method) and
...@@ -896,6 +899,7 @@ class ModulePublisher: ...@@ -896,6 +899,7 @@ class ModulePublisher:
# Do authorization checks # Do authorization checks
user=None user=None
i=0
if roles is not None: if roles is not None:
last_parent_index=len(parents) last_parent_index=len(parents)
...@@ -943,7 +947,10 @@ class ModulePublisher: ...@@ -943,7 +947,10 @@ class ModulePublisher:
break break
if user is not None: request['AUTHENTICATED_USER']=user steps=join(steps[:-i],'/')
if user is not None:
request['AUTHENTICATED_USER']=user
request['AUTHENTICATION_PATH']=steps
del parents[0] del parents[0]
# Attempt to start a transaction: # Attempt to start a transaction:
...@@ -951,10 +958,7 @@ class ModulePublisher: ...@@ -951,10 +958,7 @@ class ModulePublisher:
except: transaction=None except: transaction=None
if transaction is not None: if transaction is not None:
info="\t" + request['PATH_INFO'] info="\t" + request['PATH_INFO']
try: try: info=("%s %s" % (steps,request['AUTHENTICATED_USER']))+info
u=request['AUTHENTICATED_USER']
try: info=u+info
except: pass
except: pass except: pass
transaction.begin(info) transaction.begin(info)
...@@ -1461,6 +1465,10 @@ def publish_module(module_name, ...@@ -1461,6 +1465,10 @@ def publish_module(module_name,
# #
# $Log: Publish.py,v $ # $Log: Publish.py,v $
# Revision 1.53 1997/09/23 10:32:57 jim
# Added machinery to compute AUTHENTICATION_PATH, which is used, with
# AUTHENTICATED_USER to label transactions.
#
# Revision 1.52 1997/09/11 21:27:45 jim # Revision 1.52 1997/09/11 21:27:45 jim
# *** empty log message *** # *** empty log message ***
# #
......
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