From: Benoît Pin Date: Wed, 3 Sep 2014 21:23:50 +0000 (+0200) Subject: Prise en charge du mode d'enregistrement anonyme avec mot de passe. X-Git-Url: https://scm.cri.mines-paristech.fr/git/photoprint.git/commitdiff_plain/8044c73af157c724cd601bfb5ce90c41ca9cbca0?ds=inline Prise en charge du mode d'enregistrement anonyme avec mot de passe. --- diff --git a/locales/en/LC_MESSAGES/photoprint.po b/locales/en/LC_MESSAGES/photoprint.po index f0d7834..10842db 100644 --- a/locales/en/LC_MESSAGES/photoprint.po +++ b/locales/en/LC_MESSAGES/photoprint.po @@ -20,42 +20,46 @@ msgstr "" msgid "Log in" msgstr "" -#: t/skins/customer_add_control.py:19 +#: t/skins/customer_add_control.py:21 msgid "Please enter a given name." msgstr "" -#: t/skins/customer_add_control.py:20 +#: t/skins/customer_add_control.py:22 msgid "Please enter a name." msgstr "" -#: t/skins/customer_add_control.py:21 +#: t/skins/customer_add_control.py:23 msgid "Please enter an email." msgstr "" -#: t/skins/customer_add_control.py:22 +#: t/skins/customer_add_control.py:24 msgid "Please enter a member id." msgstr "" -#: t/skins/customer_add_control.py:23 +#: t/skins/customer_add_control.py:25 msgid "Please enter a billing address." msgstr "" -#: t/skins/customer_add_control.py:24 +#: t/skins/customer_add_control.py:26 msgid "Please enter a city." msgstr "" -#: t/skins/customer_add_control.py:25 +#: t/skins/customer_add_control.py:27 msgid "Please enter zip code." msgstr "" -#: t/skins/customer_add_control.py:26 +#: t/skins/customer_add_control.py:28 msgid "Please enter a country." msgstr "" -#: t/skins/customer_add_control.py:27 +#: t/skins/customer_add_control.py:29 msgid "Please enter a phone." msgstr "" +#: t/skins/customer_add_control.py:56 +msgid "Wrong private collection credentials." +msgstr "" + #: t/skins/customer_join_template.pt:11 msgid "New customer account" msgstr "" diff --git a/locales/fr/LC_MESSAGES/photoprint.mo b/locales/fr/LC_MESSAGES/photoprint.mo index b480a57..351787e 100644 Binary files a/locales/fr/LC_MESSAGES/photoprint.mo and b/locales/fr/LC_MESSAGES/photoprint.mo differ diff --git a/locales/fr/LC_MESSAGES/photoprint.po b/locales/fr/LC_MESSAGES/photoprint.po index e2a0659..bb0f5b3 100644 --- a/locales/fr/LC_MESSAGES/photoprint.po +++ b/locales/fr/LC_MESSAGES/photoprint.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plinn 2.0\n" -"POT-Creation-Date: Mon Sep 1 23:37:28 2014\n" +"POT-Creation-Date: Wed Sep 3 23:10:26 2014\n" "PO-Revision-Date: 2014-09-01 23:39+0200\n" "Last-Translator: Benoît PIN\n" "Language-Team: CRI http://cri.ensmp.fr\n" @@ -40,42 +40,46 @@ msgstr "Cliquez sur le bouton pour vous connecter immédiatement." msgid "Log in" msgstr "Connexion" -#: t/skins/customer_add_control.py:19 +#: t/skins/customer_add_control.py:21 msgid "Please enter a given name." msgstr "Veuillez entrer un prénom." -#: t/skins/customer_add_control.py:20 +#: t/skins/customer_add_control.py:22 msgid "Please enter a name." msgstr "Veuillez entrer un nom." -#: t/skins/customer_add_control.py:21 +#: t/skins/customer_add_control.py:23 msgid "Please enter an email." msgstr "Veuillez entrer un email." -#: t/skins/customer_add_control.py:22 +#: t/skins/customer_add_control.py:24 msgid "Please enter a member id." msgstr "Veuillez entrer un login." -#: t/skins/customer_add_control.py:23 +#: t/skins/customer_add_control.py:25 msgid "Please enter a billing address." msgstr "Veuillez entrer une addresse de facturation." -#: t/skins/customer_add_control.py:24 +#: t/skins/customer_add_control.py:26 msgid "Please enter a city." msgstr "Veuillez entrer une ville." -#: t/skins/customer_add_control.py:25 +#: t/skins/customer_add_control.py:27 msgid "Please enter zip code." msgstr "Veuillez entrer un code postal." -#: t/skins/customer_add_control.py:26 +#: t/skins/customer_add_control.py:28 msgid "Please enter a country." msgstr "Veuillez entrer un pays." -#: t/skins/customer_add_control.py:27 +#: t/skins/customer_add_control.py:29 msgid "Please enter a phone." msgstr "Veuillez entrer un numéro de téléphone." +#: t/skins/customer_add_control.py:56 +msgid "Wrong private collection credentials." +msgstr "Identifiant ou mot de passe de collection privée incorrect." + #: t/skins/customer_join_template.pt:11 msgid "New customer account" msgstr "Nouveau compte client" diff --git a/locales/photoprint.pot b/locales/photoprint.pot index 9965dd2..3ade077 100644 --- a/locales/photoprint.pot +++ b/locales/photoprint.pot @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Meaningless\n" -"POT-Creation-Date: Mon Sep 1 23:37:28 2014\n" +"POT-Creation-Date: Wed Sep 3 23:10:26 2014\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Zope 3 Developers \n" @@ -43,42 +43,46 @@ msgstr "" msgid "Log in" msgstr "" -#: t/skins/customer_add_control.py:19 +#: t/skins/customer_add_control.py:21 msgid "Please enter a given name." msgstr "" -#: t/skins/customer_add_control.py:20 +#: t/skins/customer_add_control.py:22 msgid "Please enter a name." msgstr "" -#: t/skins/customer_add_control.py:21 +#: t/skins/customer_add_control.py:23 msgid "Please enter an email." msgstr "" -#: t/skins/customer_add_control.py:22 +#: t/skins/customer_add_control.py:24 msgid "Please enter a member id." msgstr "" -#: t/skins/customer_add_control.py:23 +#: t/skins/customer_add_control.py:25 msgid "Please enter a billing address." msgstr "" -#: t/skins/customer_add_control.py:24 +#: t/skins/customer_add_control.py:26 msgid "Please enter a city." msgstr "" -#: t/skins/customer_add_control.py:25 +#: t/skins/customer_add_control.py:27 msgid "Please enter zip code." msgstr "" -#: t/skins/customer_add_control.py:26 +#: t/skins/customer_add_control.py:28 msgid "Please enter a country." msgstr "" -#: t/skins/customer_add_control.py:27 +#: t/skins/customer_add_control.py:29 msgid "Please enter a phone." msgstr "" +#: t/skins/customer_add_control.py:56 +msgid "Wrong private collection credentials." +msgstr "" + #: t/skins/customer_join_template.pt:11 msgid "New customer account" msgstr "" diff --git a/skins/customer_add_control.py b/skins/customer_add_control.py index 00b4de3..6efd42b 100755 --- a/skins/customer_add_control.py +++ b/skins/customer_add_control.py @@ -2,6 +2,8 @@ from Products.CMFCore.utils import getToolByName from Products.photoprint.utils import translate from Products.CMFDefault.utils import translate as cmf_translate +from Products.CMFCore.exceptions import AccessControl_Unauthorized +from Products.Plinn.RegistrationTool import MODE_PASS_ANONYMOUS rtool = getToolByName(context, 'portal_registration') ptool = getToolByName(context, 'portal_properties') _ = lambda msg : translate(msg, context) @@ -44,9 +46,15 @@ try: ,'billing_city' : kg('billing_city') ,'billing_zipcode' : kg('billing_zipcode') ,'country' : kg('country') - ,'phone' : kg('phone')} ) + ,'phone' : kg('phone') + ,'collection_id' : kg('collection_id') + ,'collection_password': kg('collection_password')} ) except ValueError, errmsg: return context.setStatus(False, _(errmsg)) +except AccessControl_Unauthorized : + if rtool.getMode() == MODE_PASS_ANONYMOUS : + return context.setStatus(False, _('Wrong private collection credentials.')) + raise if kg('send_password') or ptool.getProperty('validate_email') :