Commit 3bc6e127 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

closes #1111801: forgot password and login by adding login into the mail

parent b379c362f745
""" this module contains server side hooks for cleaning forgotpwd table
"""this module contains server side hooks for cleaning forgotpwd table
"""
import random
......@@ -41,7 +41,8 @@ class PasswordResetNotification(NotificationView):
__regid__ = 'notif_after_add_entity'
__select__ = is_instance('Fpasswd')
content = _('''There was recently a request to change the password on your account.
content = _('''There was recently a request to change the password of your account
on %(base_url)s (login: %(login)s).
If you requested this password change, please set a new password by following
the link below:
......@@ -54,7 +55,7 @@ See you soon on %(base_url)s !
''')
def subject(self):
return self._cw._(u'Request to change your password')
return self._cw._(u'[%s] Request to change your password' % self._cw.base_url())
def recipients(self):
fpasswd = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
......@@ -62,8 +63,12 @@ See you soon on %(base_url)s !
return [(user.cw_adapt_to('IEmailable').get_email(), user.property_value('ui.language'))]
def context(self, **kwargs):
fpasswd = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)
link = self._cw.get_shared_data('resetlink', pop=True)
user = fpasswd.reverse_has_fpasswd[0]
return {
'resetlink': self._cw.get_shared_data('resetlink', pop=True),
'resetlink': link, #self._cw.get_shared_data('resetlink', pop=True),
'login': user.login,
# NOTE: it would probably be better to display the expiration date
# (with correct timezone)
'limit': self._cw.vreg.config['revocation-limit'],
......
......@@ -4,6 +4,7 @@ msgstr ""
"PO-Revision-Date: 2010-02-04 19:13+0100\n"
"Last-Translator: Logilab Team <contact@logilab.fr>\n"
"Language-Team: en <contact@logilab.fr>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
......@@ -35,15 +36,13 @@ msgstr ""
msgid "New Fpasswd"
msgstr ""
msgid "Request to change your password"
msgstr ""
msgid "That link has either expired or is not valid."
msgstr ""
#, python-format
msgid ""
"There was recently a request to change the password on your account.\n"
"There was recently a request to change the password of your account\n"
"on %(base_url)s (login: %(login)s).\n"
"If you requested this password change, please set a new password by "
"following\n"
"the link below:\n"
......@@ -69,7 +68,11 @@ msgstr ""
msgid "You have already asked for a new password."
msgstr ""
msgid "Your password has been changed !"
msgid "Your password has been changed."
msgstr ""
#, python-format
msgid "[%s] Request to change your password"
msgstr ""
msgid "captcha"
......@@ -84,10 +87,10 @@ msgctxt "CWUser"
msgid "has_fpasswd"
msgstr ""
msgctxt "Fpasswd"
msgid "has_fpasswd_object"
msgstr ""
msgctxt "Fpasswd"
msgid "has_fpasswd_object"
msgstr ""
......
......@@ -4,6 +4,7 @@ msgstr ""
"PO-Revision-Date: 2010-02-04 19:13+0100\n"
"Last-Translator: Logilab Team <contact@logilab.fr>\n"
"Language-Team: es <contact@logilab.fr>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
......@@ -35,15 +36,13 @@ msgstr ""
msgid "New Fpasswd"
msgstr ""
msgid "Request to change your password"
msgstr ""
msgid "That link has either expired or is not valid."
msgstr ""
#, python-format
msgid ""
"There was recently a request to change the password on your account.\n"
"There was recently a request to change the password of your account\n"
"on %(base_url)s (login: %(login)s).\n"
"If you requested this password change, please set a new password by "
"following\n"
"the link below:\n"
......@@ -69,7 +68,11 @@ msgstr ""
msgid "You have already asked for a new password."
msgstr ""
msgid "Your password has been changed !"
msgid "Your password has been changed."
msgstr ""
#, python-format
msgid "[%s] Request to change your password"
msgstr ""
msgid "captcha"
......@@ -84,10 +87,10 @@ msgctxt "CWUser"
msgid "has_fpasswd"
msgstr ""
msgctxt "Fpasswd"
msgid "has_fpasswd_object"
msgstr ""
msgctxt "Fpasswd"
msgid "has_fpasswd_object"
msgstr ""
......
......@@ -4,6 +4,7 @@ msgstr ""
"PO-Revision-Date: 2010-02-04 19:13+0100\n"
"Last-Translator: Logilab Team <contact@logilab.fr>\n"
"Language-Team: fr <contact@logilab.fr>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
......@@ -37,15 +38,13 @@ msgstr "Ce lien est incorrect."
msgid "New Fpasswd"
msgstr ""
msgid "Request to change your password"
msgstr "Demande de changement de mot de passe"
msgid "That link has either expired or is not valid."
msgstr "Ce lien n'est pas valide ou a expiré"
#, python-format
msgid ""
"There was recently a request to change the password on your account.\n"
"There was recently a request to change the password of your account\n"
"on %(base_url)s (login: %(login)s).\n"
"If you requested this password change, please set a new password by "
"following\n"
"the link below:\n"
......@@ -58,13 +57,15 @@ msgid ""
"\n"
"See you soon on %(base_url)s !\n"
msgstr ""
"Une demande de changement de mot de passe vient d'être faite.\n"
"Une demande de changement de mot de passe vient d'être faite sur votre compte de \n"
"%(base_url)s (identifiant : %(login)s).\n"
"Si vous avez effectivement fait cette demande, vous pouvez réinitialiser\n"
"votre mot de passe en cliquant sur le lien suivant:\n"
"\n"
"%(resetlink)s\n"
"\n"
"Si vous ne voulez pas réinitialiser votre mot de passe, vous pouvez ignorer\n"
"Si vous ne voulez pas réinitialiser votre mot de passe, vous pouvez "
"ignorer\n"
"ce message.\n"
"Ce lien expirera dans %(limit)s minutes.\n"
"\n"
......@@ -83,9 +84,13 @@ msgid "You have already asked for a new password."
msgstr ""
"Vous avez déjà une demande de réinitialisation de mot de passe en cours."
msgid "Your password has been changed !"
msgid "Your password has been changed."
msgstr "Votre mot de passe a été changé."
#, python-format
msgid "[%s] Request to change your password"
msgstr "[%s] Demande de changement de mot de passe"
msgid "captcha"
msgstr "image test"
......@@ -98,10 +103,10 @@ msgctxt "CWUser"
msgid "has_fpasswd"
msgstr ""
msgctxt "Fpasswd"
msgid "has_fpasswd_object"
msgstr ""
msgctxt "Fpasswd"
msgid "has_fpasswd_object"
msgstr ""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment