From 8044c73af157c724cd601bfb5ce90c41ca9cbca0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Wed, 3 Sep 2014 23:23:50 +0200 Subject: [PATCH 1/1] Prise en charge du mode d'enregistrement anonyme avec mot de passe. --- locales/en/LC_MESSAGES/photoprint.po | 22 +++++++++++++--------- locales/fr/LC_MESSAGES/photoprint.mo | Bin 13368 -> 13531 bytes locales/fr/LC_MESSAGES/photoprint.po | 24 ++++++++++++++---------- locales/photoprint.pot | 24 ++++++++++++++---------- skins/customer_add_control.py | 10 +++++++++- 5 files changed, 50 insertions(+), 30 deletions(-) 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 b480a57512ef20573544d7d2d5b6ff385ff00de1..351787e9922f0fc3473a340d812a242f7d6addd8 100644 GIT binary patch delta 3556 zcmYk;c~F&A7{~D=i-K&ixFO0#5OG1}5)$N&Te;+t3uThR6>-B9MU%XySWuP_N*Jy+ zQBaQI0QA$c`kos|Ts*M*g)aYUzl_Ce#GJus^tr{Fys^bjMIWq>GQi zn2nlfA?ijIw!ICNp+?mBO{j4{LuIHPwR9cb$v;^!H|fxmK18ii2v?~cgZjQVY6;R& z7rL<#N1=Xq2{nNZ%*N}s?P7MyL@H`Rxu{G{L1l1(mx>1Tpi;XAb!^Ho11nI+@+kJl zuTh)zw(alEW2rwAhhsjb<7+q$Pa<_=3puA|QLUDTckVpjTHyfqbdz1z04QJKv{-Eamf_482~F2+cm|57Tta0_a{ z?WjGl3)?ywv)A@7cRBqVFpclGqBc{L^*Cza6R2bNscm1g{(*X+d#L*aC$X=%zlo-z z3)4~OISZA-BAkdDQBQCNwaLCh4bX}?cnP((v8;nKH4pVbg{UW9hMMR`)VN;zeI0ta z)-+HVf~QdfU&DO7gXK6q*%{y*Y6-qUO}O3qD{5_jM?GO+it~LmE~DKGHSuj2h*hWz z?@S^8nqfU1+FVEM56{~6m#6`+qAt9JTKhjyn=6E^uTv6_gK!!uQ{|{9-HMOnZXAnk z$O$*msbm?`Qpvw6i|Am(o88EUHpfwG*osQ&UHg3iox!yGA}>9Yg1MNDn$TL*o2?R+ zk-eylet@0;UdgCTCo@|Po|);T!cjIWP!p&`W#SNOfYZpI`Ofw~z(m?T20Krdjrx8a z2H^o@uI4?|1ka;>|1)Z-A7B?uWENe~JAjH(Ue3JGo+unyt`Map4JB7ObTMXCvze**7j+>}8{u?#Jhp4sd!jWLvOdgKJ z66Bud2=Xd0-=iCE<9JLN<}7J3PN2OXmDvs)hyUPe9Lwu6uo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@@ 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') : -- 2.20.1