trapping login errors/exceptions
Hi, This should be very simple but I can't get it to work. I have a method called do_login. This method can't be viewed by anonymous users. When I call this method just with <dtml-call do_login> a standard login screen is presented as expected. Now I want tot trap login errors with a try construction such as this: <dtml-try> <dtml-call do_login> <dtml-except> <p>Login error, please try again (etc.) </p> <dtml-else> <p>Login ok</p> </dtml-try> In this construction the call to do_login always raises the exception Unauthorized instead of presenting the standard login screen. How do I trap login errors in an elegant way? Is there an elegant way to trap login errors resulting from an URL? URL link to a secured object, standard login screen presented, wrong input etc. Thanks Henny van der Linde
Henny van der Linde wrote:
In this construction the call to do_login always raises the exception Unauthorized instead of presenting the standard login screen.
How do I trap login errors in an elegant way?
You can't, with the standard Zope acl_users. IIUC, LoginManager allows you to do exactly what you're talking about. cheers, Chris
Hi,
Henny van der Linde wrote:
In this construction the call to do_login always raises the exception Unauthorized instead of presenting the standard login screen.
How do I trap login errors in an elegant way?
You can't, with the standard Zope acl_users.
IIUC, LoginManager allows you to do exactly what you're talking about.
cheers,
Chris
Thanks. I already thought about using Loginmanager but we still use Zope 2.1.6. I'm very commited, to and happy with Zope but I was amazed that you can't trap Unauthorized exception like that. I'ts seems such a basic functionality. cheers, Henny
Henny van der Linde wrote:
Thanks. I already thought about using Loginmanager but we still use Zope 2.1.6.
Why? ;-)
I'm very commited, to and happy with Zope but I was amazed that you can't trap Unauthorized exception like that. I'ts seems such a basic functionality.
Yeah, I totally agree :-S cheers, Chris
Hi, ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Henny van der Linde" <info@inline-info.nl> Cc: "Zope mailing list" <zope@zope.org> Sent: Monday, October 30, 2000 11:50 AM Subject: Re: [Zope] trapping login errors/exceptions
Henny van der Linde wrote:
Thanks. I already thought about using Loginmanager but we still use Zope 2.1.6.
Why? ;-)
Just careful. Not every Zope release is realy that stable at first. Products are not always upward compatible. The sudden change in the security model with Zope 2.2.0 scared us a bit. Maybe these are minor things but we realy can't afford to experiment a lot in the organization where I (and my co Zopistas) work. BTW I can't get Login Manager installed in a very fresh Zope 2.2.2 installation. See my earlier posting. Any ideas? greetz, Henny van der Linde
participants (2)
-
Chris Withers -
Henny van der Linde