X-Git-Url: https://svn.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/ad865412e1d18480a242f20b48043f27a20f0a94..7e74f1754d15f96bd33bae06b855c48c87db2498:/RegistrationTool.py 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):