1e9b57c2519aa06091b15c7dda15bc173324211f
[Plinn.git] / skins / generic / request_password_reset_form.py
1 ##parameters=userid='', requestReset='', ajax=''
2 from Products.CMFCore.utils import getUtilityByInterfaceName
3 from Products.Plinn.utils import Message as _
4 utool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IURLTool')
5 rtool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IRegistrationTool')
6
7 if requestReset :
8 msg = rtool.requestPasswordReset(userid)
9 if not msg :
10 context.setStatus(True, _('Request for resetting password sent to your contact email.'))
11 context.setRedirect(utool.getPortalObject(), 'object/view', ajax=ajax)
12 return
13
14 context.setStatus(False, msg)
15
16 options={}
17 target = '%s/request_password_reset_form' % utool()
18 options['action'] = target
19
20 return context.request_password_reset_template(**options)