[Zope] change user password

Patrick Ulmer ulmer at truckport.de
Thu Nov 4 03:02:48 EST 2004


Hi,

> another question that zope.org could not answer:
> How can I implement a own interface to change the user password? 
> (Standard Zope acl user)


This is my Script "change_password":

Parameter List: new_password, new_password_confirm

import AccessControl
if (new_password == new_password_confirm):
  user = AccessControl.getSecurityManager().getUser()
  if (user):
    uid = user.getId()
    myreq={}
    myreq['name'] = uid
    myreq['roles'] = user.getRoles()
    myreq['domains'] = user.getDomains()
    myreq['password'] = new_password
    myreq['confirm'] = new_password_confirm
    context.acl_users.manage_users(submit='Change', REQUEST=myreq)

return context.REQUEST.RESPONSE.redirect ("content.html")

Call it like that:

<form method="POST" action="change_password" target="Inhalt">
  New Password: <input type="password" name="new_password"><br>
  Confirm Password: <input type="password" name="new_password_confirm"><br>
  <input type="submit" value="Change Password">
</form>

I don't know if it's necessary to set a Proxy-Role or change Security.

Ciao,
Patrick




More information about the Zope mailing list