From 797d6a6d2797c8ff4ac50e7a107c585f838ff282 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Wed, 31 Jul 2013 12:37:14 +0200 Subject: [PATCH] =?utf8?q?Ajouts=20messages=20de=20retour=20du=20formulair?= =?utf8?q?e=20de=20demande=20de=20r=C3=A9initialisation=20de=20mot=20de=20?= =?utf8?q?passe.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- RegistrationTool.py | 3 +++ skins/generic/request_password_reset_form.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/RegistrationTool.py b/RegistrationTool.py index f34b4a5..f31a5c6 100644 --- a/RegistrationTool.py +++ b/RegistrationTool.py @@ -225,6 +225,9 @@ class RegistrationTool(BaseRegistrationTool) : charset = 'UTF-8', body=body) mailhost.send(message) + return + + return _('Unknown user name. Please retry.') security.declarePrivate('clearExpiredPasswordResetRequests') def clearExpiredPasswordResetRequests(self): diff --git a/skins/generic/request_password_reset_form.py b/skins/generic/request_password_reset_form.py index 69a34c3..1e9b57c 100644 --- a/skins/generic/request_password_reset_form.py +++ b/skins/generic/request_password_reset_form.py @@ -1,13 +1,17 @@ -##parameters=userid='', requestReset='' +##parameters=userid='', requestReset='', ajax='' 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 !' + msg = rtool.requestPasswordReset(userid) + if not msg : + context.setStatus(True, _('Request for resetting password sent to your contact email.')) + context.setRedirect(utool.getPortalObject(), 'object/view', ajax=ajax) + return + + context.setStatus(False, msg) options={} target = '%s/request_password_reset_form' % utool() -- 2.20.1