Re: [Zope] User changing their own password via External Method with Cookie Crumbler
On Wednesday 30 March 2005 12:00, zope-request@zope.org wrote:
Dave Cinege wrote:
Does anyone have a working example code snippet?
Have a look at the CMF source code, find the bit that allows users to change their own passwords...
Thanks. I was hoping it wouldn't come to that... From what I was able to dissect from CMF changing the password is down to a hack. : P userFolderEditUser() doesn't work. You must instead change the '__' attribute of a user object. : O My code below works, except that credentialsChanged() ends up redirecting to the login page vs, resetting the cookie and allowing the user to continue. Is that expected? def UserEditFunc (self): reqd = dict(self.REQUEST) user = self.acl_users.getUser(reqd['username']) user.__ = reqd['password'] self.login.credentialsChanged(user,reqd['username'],reqd['password'])
Dave Cinege wrote:
From what I was able to dissect from CMF changing the password is down to a hack. : P userFolderEditUser() doesn't work. You must instead change the '__' attribute of a user object.
Why am I not suprised? ;-) : O My code below works, except that
credentialsChanged() ends up redirecting to the login page vs, resetting the cookie and allowing the user to continue. Is that expected?
No, don't think so.
def UserEditFunc (self): reqd = dict(self.REQUEST) user = self.acl_users.getUser(reqd['username']) user.__ = reqd['password']
This makes assumptions about the user folder implementation. If you're using anything other than a normal stock userfolder, beware! cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (2)
-
Chris Withers -
Dave Cinege