Commit fb82351a authored by Jim Fulton's avatar Jim Fulton

Added an indication of whether an authoization header was present to

unauthorized errors.
parent f57eaf49
...@@ -478,11 +478,11 @@ Publishing a module using CGI ...@@ -478,11 +478,11 @@ 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.100 1998/09/21 23:37:09 jim Exp $""" $Id: Publish.py,v 1.101 1998/09/22 16:44:37 jim Exp $"""
#' #'
# #
########################################################################## ##########################################################################
__version__='$Revision: 1.100 $'[11:-2] __version__='$Revision: 1.101 $'[11:-2]
import sys, os, string, cgi, regex import sys, os, string, cgi, regex
from string import * from string import *
...@@ -667,11 +667,10 @@ class ModulePublisher: ...@@ -667,11 +667,10 @@ class ModulePublisher:
if not (self.request.has_key('REMOTE_USER') and if not (self.request.has_key('REMOTE_USER') and
self.request['REMOTE_USER']): self.request['REMOTE_USER']):
self.response['WWW-authenticate']='basic realm="%s"' % realm self.response['WWW-authenticate']='basic realm="%s"' % realm
raise 'Unauthorized', ( m="<strong>You are not authorized to access this resource.</strong>"
"""<strong>You are not authorized to access this resource. if not self.HTTP_AUTHORIZATION:
</strong> m=m+'\n<!-- No Authorization header-->'
""" raise 'Unauthorized', m
)
def forbiddenError(self,object=None): def forbiddenError(self,object=None):
raise 'NotFound',self.html( raise 'NotFound',self.html(
......
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