Using the authenticate method of an authenticated user
Hello. I am reposting this message because I was unable to receive any replies for it since "mail delivery" option was disabled in Yahoo. My apologies for flooding everyone's mailbox. Also, I would greatly appreciate if those of you who answered this question could forward a copy of your response to me. Thanks for all your help. -Asad The following is the message I posted this weekend: Hello. I am trying to use the authenticate method to determine if a user is entering the same password as the one they currently have. I have a form that allows the user to change their password. So, after the user authenticates(i.e. starts a Zope session), they navigate to this form and type in their new password. After the form is submitted but before changing the user's password, I would like to check if the password they are entering is different from the one they currently have. If it is not, I redirect them to another page informing them that they have to enter another password. To check if the password the user has entered matches their current password, I use the following statement in a DTML method: <dtml-if expr "acl_users.getUser(name).authenticate(password, REQUEST)"> However, using this statement gives me an error that reads the following: Error Type: Unauthorized Error Value: The container has no security assertions. Access to 'authenticate' of rwolf denied. I have no idea why I am getting this error. Any help would be greatly appreciated. Thanks. -Asad __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com
Asad! It is not possible to do this from TTW code. Write an ExternalMethod and make it look something like: def check_password(acl_users, name, password, request): user = acl_users.getUser(name).__of__(acl_users) return user.authenticate(password, request) Then do yourself a favour and stop using DTML, it is a waste of time. ;-) Stefan --On Montag, 28. April 2003 05:49 -0700 Asad Habib <ahabib1357@yahoo.com> wrote:
<dtml-if expr "acl_users.getUser(name).authenticate(password, REQUEST)">
However, using this statement gives me an error that reads the following:
Error Type: Unauthorized Error Value: The container has no security assertions. Access to 'authenticate' of rwolf denied.
I have no idea why I am getting this error. Any help would be greatly appreciated. Thanks.
-Asad
-- The time has come to start talking about whether the emperor is a well dressed as we are supposed to think he is. /Pete McBreen/
participants (2)
-
Asad Habib -
Stefan H. Holek