From 773a32c20340b63d244d2a43d6fd62103e723bc5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Mon, 29 Jul 2013 16:49:50 +0200 Subject: [PATCH] =?utf8?q?Quelques=20pr=C3=A9paratifs=20avant=20l'impl?= =?utf8?q?=C3=A9mentation=20de=20l'envoi=20du=20rappel.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- RegistrationTool.py | 2 +- skins/generic/request_password_reset_form.py | 16 ++++++++++++++++ ...orm.pt => request_password_reset_template.pt} | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 skins/generic/request_password_reset_form.py rename skins/generic/{request_password_reset_form.pt => request_password_reset_template.pt} (86%) 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.

-
+ - +
-- 2.20.1