From 7b145f8e9dea2adbf9616bd40f80be71e557c9bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Tue, 30 Jul 2013 15:27:38 +0200 Subject: [PATCH 1/1] =?utf8?q?Suite=20de=20l'impl=C3=A9mentation=20de=20la?= =?utf8?q?=20r=C3=A9initialisation=20de=20mot=20de=20passe.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- RegistrationTool.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/RegistrationTool.py b/RegistrationTool.py index 85133ff..953e008 100644 --- a/RegistrationTool.py +++ b/RegistrationTool.py @@ -196,10 +196,17 @@ class RegistrationTool(BaseRegistrationTool) : """ add uuid / (userid, expiration) pair and return uuid """ self.clearExpiredPasswordResetRequests() mtool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IMembershipTool') - if mtool.getMemberById(userid) : + member = mtool.getMemberById(userid) + if member : uuid = str(uuid4()) self._passwordResetRequests[uuid] = (userid, DateTime() + 1) - return uuid + mailhost = getUtilityByInterfaceName('Products.MailHost.interfaces.IMailHost') + ptool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IPropertiesTool') + utool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IURLTool') + sender = ptool.getProperty('email_from_address') + to = member.getProperty('email') + message = self.echange_mail_template(From=sender, + To=to) security.declarePrivate('clearExpiredPasswordResetRequests') def clearExpiredPasswordResetRequests(self): -- 2.20.1