Re: [Zope] User changing their own password via External Method with Cookie Crumbler
On Tuesday 29 March 2005 12:00, zope-request@zope.org wrote:
Take a look at the CookieCrumbler code, there is a method that will update the cookie for you:
credentialsChanged(self, user, name, pw)
Thanks. I've tried self.login.credentialsChanged(reqd['username'],reqd['username'],reqd['password']) Both before and after self.acl_users.userFolderEditUser(reqd['username'],reqd['password'],'','') And it doens't seem to help. The password never changes. Should I be calling credentialsChanged() as a method to something else? ('login' is the Cookie rumbler folder) Does anyone have a working example code snippet? Dave
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... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Dave Cinege <dcinege-mlists@psychosis.com> wrote:
self.login.credentialsChanged(reqd['username'],reqd['username'],reqd['password'])
Both before and after self.acl_users.userFolderEditUser(reqd['username'],reqd['password'],'','')
That should be self.acl_users.userFolderEditUser(username, password, roles, domains) the domains may be [] (it's hardly ever used) but the roles have to be the roles you give to the user. You may want to do username = reqd['username'] password = reqd['password'] aclu = self.acl_users user = aclu.getUser(username) if user is not None: aclu.userFolderEditUser(username, password, user.getRoles(), user.getDomains()) Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
participants (3)
-
Chris Withers -
Dave Cinege -
Florent Guillaume