Hello, Some pages of my zope project are protected by acl_users. I would like to redirect the wrong login to another page. How to do that ? Do I need another product ? I'm using Zope 2.1.6. Is it possible to do that with the standard_error_message ? ATON Belgium Avenue Reine Astrid, 7 B-1440 Wauthier Braine Tél: +32(2)366.25.08 Fax: +32(2)366.25.14
William JOYE wrote:
Some pages of my zope project are protected by acl_users. I would like to redirect the wrong login to another page. How to do that ? Do I need another product ?
I'm using Zope 2.1.6. Is it possible to do that with the standard_error_message ?
There was some discussion about this a while back... Zope needs some fixing to be able to do this, but, IIRC, it should be possible and is actually in the collector. If I had the knowledge, I'd do it, but I don't, so I'd love it if someone who did know could implement it ;-) cheers, Chris PS: The problem, in short, is that Authentication and Authorization Exceptions currently use Zope's internal, hard coded, error message rather than acquiring standard_error_message. In fact, I seem to remember a comment in the code to the effect that 'maybe this could be done differently'
Hi, Great another Belgian Zope user. That makes 4? Ok, now to your q'n : What about <dtml-unless "Authenticated_user.has_role('Manager')"> <dtml-call "RESPONSE.redirect('go_to_this_page_html')"> </dtml-unless> Regards, Tom. At 17:21 21/09/2000 +0200, William JOYE wrote:
Hello,
Some pages of my zope project are protected by acl_users. I would like to redirect the wrong login to another page. How to do that ? Do I need another product ?
I'm using Zope 2.1.6. Is it possible to do that with the standard_error_message ?
ATON Belgium Avenue Reine Astrid, 7 B-1440 Wauthier Braine Tél: +32(2)366.25.08 Fax: +32(2)366.25.14
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
That works fine, but Id rather use the Zope authentication / authorization system thats there than try to write my own along with the inevitable problems that can occur. Chris - you correct the comment says something about this could use standard_error_message.... I did a quick hack of changing the source for that file so it looks pretty (of course its totally static). Works for me. ----- Original Message ----- From: "Tom Deprez" <tom.deprez@uz.kuleuven.ac.be> To: "William JOYE" <wjoye@phase.be>; <zope@zope.org> Sent: Thursday, September 21, 2000 8:54 AM Subject: Re: [Zope] How-to trap login error ?
Hi,
Great another Belgian Zope user. That makes 4?
Ok, now to your q'n :
What about
<dtml-unless "Authenticated_user.has_role('Manager')"> <dtml-call "RESPONSE.redirect('go_to_this_page_html')"> </dtml-unless>
Regards, Tom.
At 17:21 21/09/2000 +0200, William JOYE wrote:
Hello,
Some pages of my zope project are protected by acl_users. I would like to redirect the wrong login to another page. How to do that ? Do I need another product ?
I'm using Zope 2.1.6. Is it possible to do that with the standard_error_message ?
ATON Belgium Avenue Reine Astrid, 7 B-1440 Wauthier Braine Tél: +32(2)366.25.08 Fax: +32(2)366.25.14
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Andy McKay wrote:
Chris - you correct the comment says something about this could use standard_error_message.... I did a quick hack of changing the source for that file so it looks pretty (of course its totally static). Works for me.
Well can you please, please, please put it in the Collector as a 'bug with Patch' so everyone else can benefit. :-) ...or at the very least post the patch to the list... cheers, Chris
Well theres the thing, its not really a patch. I doesnt allow Authorized Exceptions to use standard_error_message, thats a whole different kettle of fish. /lib/python/ZPublishers/HTTPResponse.py line 482 to 523 contains HTML text for the error message. So you can rewrite that. Thats all I have done. ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Andy McKay" <andym@activestate.com> Cc: "William JOYE" <wjoye@phase.be>; <zope@zope.org>; "Tom Deprez" <tom.deprez@uz.kuleuven.ac.be> Sent: Friday, September 22, 2000 1:26 AM Subject: Patch to let Authorized Exceptions use standard_error_message
Andy McKay wrote:
Chris - you correct the comment says something about this could use standard_error_message.... I did a quick hack of changing the source for that file so it looks pretty (of course its totally static). Works for me.
Well can you please, please, please put it in the Collector as a 'bug with Patch' so everyone else can benefit. :-)
...or at the very least post the patch to the list...
cheers,
Chris
Andy McKay wrote:
Well theres the thing, its not really a patch. I doesnt allow Authorized Exceptions to use standard_error_message, thats a whole different kettle of fish.
/lib/python/ZPublishers/HTTPResponse.py line 482 to 523 contains HTML text for the error message. So you can rewrite that. Thats all I have done.
Ah well, there you go, getting my hopes up :-( *grinz* Chris
participants (4)
-
Andy McKay -
Chris Withers -
Tom Deprez -
William JOYE