From: Benoît Pin Date: Mon, 29 Jul 2013 14:49:50 +0000 (+0200) Subject: Quelques préparatifs avant l'implémentation de l'envoi du rappel. X-Git-Url: https://svn.cri.ensmp.fr/git/Plinn.git/commitdiff_plain/773a32c20340b63d244d2a43d6fd62103e723bc5?ds=sidebyside Quelques préparatifs avant l'implémentation de l'envoi du rappel. --- diff --git a/RegistrationTool.py b/RegistrationTool.py index 7d2f29b..109a0d6 100644 --- a/RegistrationTool.py +++ b/RegistrationTool.py @@ -204,7 +204,7 @@ class RegistrationTool(BaseRegistrationTool) : 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] diff --git a/skins/generic/request_password_reset_form.py b/skins/generic/request_password_reset_form.py new file mode 100644 index 0000000..69a34c3 --- /dev/null +++ b/skins/generic/request_password_reset_form.py @@ -0,0 +1,16 @@ +##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 diff --git a/skins/generic/request_password_reset_form.pt b/skins/generic/request_password_reset_template.pt similarity index 86% rename from skins/generic/request_password_reset_form.pt rename to skins/generic/request_password_reset_template.pt index fe7c384..1047b66 100644 --- a/skins/generic/request_password_reset_form.pt +++ b/skins/generic/request_password_reset_template.pt @@ -20,9 +20,9 @@ tal:content="ptool/email_from_address" href="mailto:me@here.com" i18n:name="admin_email">me@here.com.

-
+ - +