From: Benoît Pin Date: Thu, 1 Aug 2013 14:06:56 +0000 (+0200) Subject: Mise au point de l'envoi du mail de réinitialisation de mot de passe. X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/commitdiff_plain/aefda44ab040aa30d29723ff652cb264c53eeb26?ds=sidebyside;hp=4f6cc7ed9e24196383be02e8bbc38e02795b08ab Mise au point de l'envoi du mail de réinitialisation de mot de passe. --- diff --git a/RegistrationTool.py b/RegistrationTool.py index 021b714..72a7329 100644 --- a/RegistrationTool.py +++ b/RegistrationTool.py @@ -38,10 +38,10 @@ from Products.GroupUserFolder.GroupsToolPermissions import ManageGroups from Products.Plinn.utils import Message as _ from Products.Plinn.utils import translate from Products.Plinn.utils import encodeQuopriEmail +from Products.Plinn.utils import encodeMailHeader from DateTime import DateTime from types import TupleType, ListType from uuid import uuid4 -from quopri import encodestring security = ModuleSecurityInfo('Products.Plinn.RegistrationTool') MODE_ANONYMOUS = 'anonymous' @@ -215,11 +215,11 @@ class RegistrationTool(BaseRegistrationTool) : sender = encodeQuopriEmail(ptool.getProperty('email_from_name'), ptool.getProperty('email_from_address')) to = encodeQuopriEmail(member.getMemberFullName(nameBefore=0), member.getProperty('email')) subject = translate(_('How to reset your password on the %s website')) % ptool.getProperty('title') - subject = "=?utf-8?q?%s?=" % encodestring(subject) - body = self.password_reset_mail_template(fullName=member.getMemberFullName(nameBefore=0), - siteName=ptool.getProperty('title'), - resetPasswordUrl='%s/password_reset_form/%s' % (utool(), uuid) - ) + subject = encodeMailHeader(subject) + options = {'fullName' : member.getMemberFullName(nameBefore=0), + 'siteName' : ptool.getProperty('title'), + 'resetPasswordUrl' : '%s/password_reset_form/%s' % (utool(), uuid)} + body = self.password_reset_mail(options) message = self.echange_mail_template(From=sender, To=to, Subject=subject, diff --git a/locales/en/LC_MESSAGES/plinn.mo b/locales/en/LC_MESSAGES/plinn.mo index 4cd15ff..5e4bf2b 100644 Binary files a/locales/en/LC_MESSAGES/plinn.mo and b/locales/en/LC_MESSAGES/plinn.mo differ diff --git a/locales/en/LC_MESSAGES/plinn.po b/locales/en/LC_MESSAGES/plinn.po index 7e6bac9..7d41f54 100644 --- a/locales/en/LC_MESSAGES/plinn.po +++ b/locales/en/LC_MESSAGES/plinn.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plinn 2.0\n" -"POT-Creation-Date: Thu Aug 1 11:47:35 2013\n" +"POT-Creation-Date: Thu Aug 1 14:40:48 2013\n" "PO-Revision-Date: 2007-10-17 14:43+0200\n" "Last-Translator: Benoît PIN\n" "Language-Team: CRI http://cri.ensmp.fr\n" @@ -999,30 +999,30 @@ msgstr "" msgid "Exit boxes editing" msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:1 -msgid "Hi ${fullname}," +#: n/skins/generic/password_reset_mail.py:4 +msgid "Hi %(fullName)s," msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:4 +#: n/skins/generic/password_reset_mail.py:6 msgid "You have asked to change your password." msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:6 +#: n/skins/generic/password_reset_mail.py:8 msgid "" -"To get back into your account on the ${siteName} website, you'll need to " +"To get back into your account on the %(siteName)s website, you'll need to " "create a new password." msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:7 +#: n/skins/generic/password_reset_mail.py:9 msgid "It's easy:" msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:8 -msgid "— Click the link below to open a browser window." +#: n/skins/generic/password_reset_mail.py:10 +msgid "Click the link below to open a browser window." msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:9 -msgid "— Fill the form with your new password." +#: n/skins/generic/password_reset_mail.py:11 +msgid "Fill the form with your new password." msgstr "" #: n/skins/generic/password_reset_template.pt:13 diff --git a/locales/fr/LC_MESSAGES/plinn.mo b/locales/fr/LC_MESSAGES/plinn.mo index f151770..4d68fb1 100644 Binary files a/locales/fr/LC_MESSAGES/plinn.mo and b/locales/fr/LC_MESSAGES/plinn.mo differ diff --git a/locales/fr/LC_MESSAGES/plinn.po b/locales/fr/LC_MESSAGES/plinn.po index 58520fd..4000686 100755 --- a/locales/fr/LC_MESSAGES/plinn.po +++ b/locales/fr/LC_MESSAGES/plinn.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Plinn 2.0\n" -"POT-Creation-Date: Thu Aug 1 11:47:35 2013\n" -"PO-Revision-Date: 2013-08-01 11:49+0200\n" +"POT-Creation-Date: Thu Aug 1 14:40:48 2013\n" +"PO-Revision-Date: 2013-08-01 14:42+0200\n" "Last-Translator: Benoît PIN\n" "Language-Team: CRI http://cri.ensmp.fr\n" "Language: \n" @@ -1035,33 +1035,33 @@ msgstr "Coller" msgid "Exit boxes editing" msgstr "Quitter l'édition des boîtes" -#: n/skins/generic/password_reset_mail_temlate.pt:1 -msgid "Hi ${fullname}," -msgstr "Bonjour ${fullname}," +#: n/skins/generic/password_reset_mail.py:4 +msgid "Hi %(fullName)s," +msgstr "Bonjour %(fullName)s," -#: n/skins/generic/password_reset_mail_temlate.pt:4 +#: n/skins/generic/password_reset_mail.py:6 msgid "You have asked to change your password." msgstr "Vous avez demandé de changer de mot de passe." -#: n/skins/generic/password_reset_mail_temlate.pt:6 +#: n/skins/generic/password_reset_mail.py:8 msgid "" -"To get back into your account on the ${siteName} website, you'll need to " +"To get back into your account on the %(siteName)s website, you'll need to " "create a new password." msgstr "" -"Pour accéder à nouveau à votre compte sur le site ${siteName}, vous devez " +"Pour accéder à nouveau à votre compte sur le site %(siteName)s, vous devez " "créer un nouveau mot de passe." -#: n/skins/generic/password_reset_mail_temlate.pt:7 +#: n/skins/generic/password_reset_mail.py:9 msgid "It's easy:" msgstr "Rien de plus simple :" -#: n/skins/generic/password_reset_mail_temlate.pt:8 -msgid "— Click the link below to open a browser window." -msgstr "— Cliquez sur le lien ci-dessous pour ouvrir une fenêtre de navigateur." +#: n/skins/generic/password_reset_mail.py:10 +msgid "Click the link below to open a browser window." +msgstr "Cliquez sur le lien ci-dessous pour ouvrir une fenêtre de navigateur." -#: n/skins/generic/password_reset_mail_temlate.pt:9 -msgid "— Fill the form with your new password." -msgstr "— Remplissez le formulaire avec votre nouveau mot de passe." +#: n/skins/generic/password_reset_mail.py:11 +msgid "Fill the form with your new password." +msgstr "Remplissez le formulaire avec votre nouveau mot de passe." #: n/skins/generic/password_reset_template.pt:13 msgid "Password resetting" @@ -2229,6 +2229,23 @@ msgstr "Cc" msgid "mail_bcc" msgstr "Cci" +#~ msgid "— Click the link below to open a browser window." +#~ msgstr "" +#~ "— Cliquez sur le lien ci-dessous pour ouvrir une fenêtre de navigateur." + +#~ msgid "— Fill the form with your new password." +#~ msgstr "— Remplissez le formulaire avec votre nouveau mot de passe." + +#~ msgid "Hi ${fullname}," +#~ msgstr "Bonjour ${fullname}," + +#~ msgid "" +#~ "To get back into your account on the ${siteName} website, you'll need to " +#~ "create a new password." +#~ msgstr "" +#~ "Pour accéder à nouveau à votre compte sur le site ${siteName}, vous devez " +#~ "créer un nouveau mot de passe." + #~ msgid "Invalid userid." #~ msgstr "Login invalide." diff --git a/locales/plinn.pot b/locales/plinn.pot index 886a0fd..b40c584 100644 --- a/locales/plinn.pot +++ b/locales/plinn.pot @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: 2.0 beta 1\n" -"POT-Creation-Date: Thu Aug 1 11:47:35 2013\n" +"POT-Creation-Date: Thu Aug 1 14:40:48 2013\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Zope 3 Developers \n" @@ -1021,28 +1021,28 @@ msgstr "" msgid "Exit boxes editing" msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:1 -msgid "Hi ${fullname}," +#: n/skins/generic/password_reset_mail.py:4 +msgid "Hi %(fullName)s," msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:4 +#: n/skins/generic/password_reset_mail.py:6 msgid "You have asked to change your password." msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:6 -msgid "To get back into your account on the ${siteName} website, you'll need to create a new password." +#: n/skins/generic/password_reset_mail.py:8 +msgid "To get back into your account on the %(siteName)s website, you'll need to create a new password." msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:7 +#: n/skins/generic/password_reset_mail.py:9 msgid "It's easy:" msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:8 -msgid "\342\200\224\302\240Click the link below to open a browser window." +#: n/skins/generic/password_reset_mail.py:10 +msgid "Click the link below to open a browser window." msgstr "" -#: n/skins/generic/password_reset_mail_temlate.pt:9 -msgid "\342\200\224 Fill the form with your new password." +#: n/skins/generic/password_reset_mail.py:11 +msgid "Fill the form with your new password." msgstr "" #: n/skins/generic/password_reset_template.pt:13 diff --git a/skins/generic/password_reset_mail.py b/skins/generic/password_reset_mail.py new file mode 100644 index 0000000..442a1f6 --- /dev/null +++ b/skins/generic/password_reset_mail.py @@ -0,0 +1,15 @@ +##parameters=options={} +from Products.Plinn.utils import translate as _ + +print _('Hi %(fullName)s,') +print +print _('You have asked to change your password.') + +print _("To get back into your account on the %(siteName)s website, you'll need to create a new password.") +print _("It's easy:") +print '— %s' % _("Click the link below to open a browser window.") +print '— %s' % _("Fill the form with your new password.") +print +print '%(resetPasswordUrl)s' + +return printed % options \ No newline at end of file diff --git a/skins/generic/password_reset_mail_template.pt b/skins/generic/password_reset_mail_template.pt deleted file mode 100644 index 261abd3..0000000 --- a/skins/generic/password_reset_mail_template.pt +++ /dev/null @@ -1,10 +0,0 @@ -Hi , - -You have asked to change your password. - -To get back into your account on the website, you'll need to create a new password. -It's easy: -— Click the link below to open a browser window. -— Fill the form with your new password. - -http://portal.bla/password_reset_form/uuid