1 ##parameters=validate=''
2 from Products
.CMFCore
.utils
import getUtilityByInterfaceName
3 from Products
.Plinn
.utils
import Message
as _
4 utool
= getUtilityByInterfaceName('Products.CMFCore.interfaces.IURLTool')
5 atool
= getUtilityByInterfaceName('Products.CMFCore.interfaces.IActionsTool')
7 form
= context
.REQUEST
.form
8 uuid
= traverse_subpath
[0]
10 passwordChanged
= False
13 context
.validatePassword(**form
) :
14 userid
= context
.reset_password_control(uuid
=uuid
, **form
)
16 passwordChanged
= True
19 options
['uuid'] = uuid
20 options
['passwordChanged'] = passwordChanged
22 hidden_vars
= ({'name' : '__ac_name', 'value' : userid
},
23 {'name' : '__ac_password', 'value' : form
['password']},
24 {'name' : 'noAjax', 'value' : '1'})
26 buttons
= ({'name': 'login', 'value': _(' Login ')},)
29 target
= '%s/password_reset_form/%s' % (utool(), uuid
)
30 buttons
= ({'name': 'validate', 'value': _('Validate')},)
32 options
['form'] = { 'action': target
,
33 'listButtonInfos': tuple(buttons
),
34 'listHiddenVarInfos': hidden_vars
}
37 return context
.password_reset_template(**options
)