Michal, Please use the Zope list to ask questions, thanks. The answer is somewhat silly. When you call this method, and you enter authentication credentials, Zope tries to render the method. Rendering the method raises an unauthorized. Then you enter your credentials again. And it raises unauthorized again. Etc. The purpose of raising unauthorized here is to clear your credentials from the browser. If you hit OK on the dialog (without entering any username or password), and then visit *another* method, you will be able to log in as a different user. I hope this makes sense, - C ----- Original Message ----- From: "Michal Krejza" <michal.krejza@disagroup.cz> To: "'Chris McDonough'" <chrism@digicool.com> Sent: Monday, January 08, 2001 9:26 AM Subject: Raise a Login Dialog
Hi, I try to force a popup box for logon to Zope. For login I call this method:
<dtml-var standard_html_header> <dtml-raise Unauthorized> You are not logged in. </dtml-raise> <p>Now you are in ...</p> <dtml-var standard_html_footer>
But this dialog doesn't accept login information. It looks as I am using bad user name and password, but it's not true. What should I do to use this dialog in right way. I read Zope book about Raisin exception, but without success ....
Mohan,
The standard Zope user folder handles only basic authentication which generally needs to be done via a popup dialog on your browser. At some point, a user needs to type his authentication credentials into the dialog. The Zope security machinery handles this in the background.
To force a popup box to be displayed:
<dtml-raise Unauthorized> You are not logged in. </dtml-raise>
There is a user folder product named "UserDb" which supports cookie authentication that lets you create a custom login form. There is also the "LoginManager" product, which I think allows you to do the same (though I've not used it).
----- Original Message ----- From: "Mohan Baro" <mcbaro@uwimona.edu.jm> To: "Michal Krejza" <michal.krejza@disagroup.cz>; <zope@zope.org> Sent: Thursday, January 04, 2001 12:45 PM Subject: RE: [Zope] Login dialog - another newbie question
Hi there,
I have been trying to do the same. i.e. create a logon form, what I have been told so far is that: 1) I have to use the method user.authenticate(????,????) 2) however I have found no documentation for user.authenticate() anywhere 3) others have suggested that I read the source: ZOPE_DIR/lib/python/AccessControl/User.py
I think its has to be something like..... <dtml-call "REQUEST.set('name', 'k.laird.1')"> <dtml-call "REQUEST.set('password', '5678')"> <dtml-call "acl_users.authenticate('Login', REQUEST, RESPONSE)">
Let me know if you manage to create a login form.
Mohan.
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Michal Krejza Sent: Thursday, January 04, 2001 3:38 AM To: zope@zope.org Subject: [Zope] Login dialog - another newbie question
Hi Zopitas, I have problem with authentication in Zope. I made small site in our company, and some informations are visible for anonymous user and some for managers. So I need to authorize users before they connect to restricted area. It's late for me, becose access to restricted methods is able through links, which are visible only for managers. Is there any way to make some form for login to Zope. But without another application like LoginManager or MySQL User Folder and etc. My Zope server is running on WinNT and I have problem with these application.
Michal Krejza
_______________________________________________ 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 )