security.declarePrivate('clearExpiredPasswordResetRequests')
def clearExpiredPasswordResetRequests(self):
now = DateTime()
- for uuid, record in self._passwordResetRequest.items() :
+ for uuid, record in self._passwordResetRequests.items() :
userid, date = record
if date < now :
del self._passwordResetRequests[uuid]
--- /dev/null
+##parameters=userid='', requestReset=''
+from Products.CMFCore.utils import getUtilityByInterfaceName
+from Products.Plinn.utils import Message as _
+utool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IURLTool')
+rtool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IRegistrationTool')
+
+if requestReset :
+ uuid = rtool.requestPasswordReset(userid)
+ context.setStatus(True, _('request for resetting password sent'))
+ return 'yeah !'
+
+options={}
+target = '%s/request_password_reset_form' % utool()
+options['action'] = target
+
+return context.request_password_reset_template(**options)
\ No newline at end of file
tal:content="ptool/email_from_address" href="mailto:me@here.com"
i18n:name="admin_email">me@here.com</a>.
</p>
- <form action="mail_password" tal:attributes="action string:${here/portal_url}/mail_password">
+ <form action="mail_password" tal:attributes="action options/action">
<input name="userid"/>
- <input type="submit" value=" Send " i18n:attributes="value"/>
+ <input type="submit" name="requestReset" value=" Send " i18n:attributes="value"/>
</form>
</div>
</div>