1 ## Script (Python) "change_password"
2 ##bind container=container
6 ##bind subpath=traverse_subpath
7 ##parameters=password, confirm, domains=None
8 ##title=Change password
13 ## This code is there because there's a bug in CMF that prevents
14 ## passwords to be changed if the User Folder doesn't store it in a __
16 ## This includes User Folders such as LDAPUF, SimpleUF, and, of course, GRUF.
17 ## This also includes standard UF with password encryption !
19 mt
= context
.portal_membership
20 failMessage
=context
.portal_registration
.testPasswordValidity(password
, confirm
)
23 return context
.password_form(context
,
26 context
.REQUEST
['AUTHENTICATED_USER'].changePassword(password
,REQUEST
=context
.REQUEST
)
27 mt
.credentialsChanged(password
)
28 return context
.personalize_form(context
,
30 portal_status_message
='Password changed.')