[Zope] how to catch the error message following the failed login via dtm
Wed, 11 Jun 2003 17:07:18 +0200
I have the following problem:
I have created a website which is generally accessible to everybody without
the need to login(user = anonymous).
Some areas of the site are reserved only to users who have an account in the
acl users folders.
When a user tries to access the restricted areas but does not have the right
to or pushes the cancel button, then he gets the following error message:
An error was encountered while publishing this resource.
You are not authorized to access this resource.
Traceback (innermost last):
File C:\Zope\lib\python\ZPublisher\Publish.py, line 150, in publish_module
File C:\Zope\lib\python\ZPublisher\Publish.py, line 114, in publish
File C:\Zope\lib\python\Zope\__init__.py, line 158, in
File C:\Zope\lib\python\ZPublisher\Publish.py, line 89, in publish
File C:\Zope\lib\python\ZPublisher\BaseRequest.py, line 404, in traverse
File C:\Zope\lib\python\ZPublisher\HTTPResponse.py, line 511, in
Unauthorized: (see above)
Here is the example code which produces this error:
User: <dtml-var "AUTHENTICATED_USER.getUserName()">
Failed to login
Unfortunatelly it does not work. Instead I just get the above error message.
Do you have any idea as how to do it?