1 ##parameters=userid='', requestReset='', ajax=''
2 from Products
.CMFCore
.utils
import getUtilityByInterfaceName
3 from Products
.Plinn
.utils
import translate
5 _
= lambda msg
: translate(msg
, context
)
6 utool
= getUtilityByInterfaceName('Products.CMFCore.interfaces.IURLTool')
7 rtool
= getUtilityByInterfaceName('Products.CMFCore.interfaces.IRegistrationTool')
10 msg
= rtool
.requestPasswordReset(userid
)
12 context
.setStatus(True, _('Request for resetting password sent to your contact email.'))
13 context
.setRedirect(utool
.getPortalObject(), 'object/view', ajax
=ajax
)
16 context
.setStatus(False, msg
)
19 target
= '%s/request_password_reset_form' % utool()
20 options
['action'] = target
22 return context
.request_password_reset_template(**options
)