From 4108abadea5456a9d832614c32b93925425f6904 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Mon, 1 Sep 2014 20:50:28 +0200 Subject: [PATCH] =?utf8?q?Mise=20=C3=A0=20jour=20des=20templates=20/=20scr?= =?utf8?q?ipt=20pour=20les=20inscriptions=20client.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- skins/customer_add_control.py | 2 +- skins/customer_join_form.py | 8 ++++++-- skins/customer_join_template.pt | 30 +++++++++++++++++++++++++++++- skins/customer_login_form.pt | 2 +- skins/validatePrivateAccess.py | 16 ++++++++++++++++ 5 files changed, 53 insertions(+), 5 deletions(-) create mode 100755 skins/validatePrivateAccess.py diff --git a/skins/customer_add_control.py b/skins/customer_add_control.py index 274f4c6..8280dbc 100755 --- a/skins/customer_add_control.py +++ b/skins/customer_add_control.py @@ -1,6 +1,6 @@ ##parameters=**kw from Products.CMFCore.utils import getToolByName -from Products.realis.utils import translate +from Products.photoprint.utils import translate from Products.CMFDefault.utils import translate as cmf_translate rtool = getToolByName(context, 'portal_registration') ptool = getToolByName(context, 'portal_properties') diff --git a/skins/customer_join_form.py b/skins/customer_join_form.py index 4df2848..13422ea 100755 --- a/skins/customer_join_form.py +++ b/skins/customer_join_form.py @@ -1,6 +1,6 @@ ##parameters=add='' from Products.CMFCore.utils import getToolByName -from Products.realis.utils import translate +from Products.Plinn.utils import translate from ZTUtils import make_query as mq _ = lambda msg : translate(msg, context) ptool = getToolByName(script, 'portal_properties') @@ -17,7 +17,8 @@ fg = lambda name : form.get(name,'').strip() if add and \ context.validatePassword(**form) and \ - context.customer_add_control(**form) : + context.customer_add_control(**form) and \ + context.validatePrivateAccess(**form) : came_from = fg('came_from') if came_from : return context.setRedirect( atool, 'user/logged_in' @@ -39,6 +40,9 @@ continuationFields = [ , 'password' , 'confirm' , 'send_password' + , 'wedding_id' + , 'wedding_password' + , 'wedding_password_confirm' , 'billing_address' , 'billing_city' , 'billing_zipcode' diff --git a/skins/customer_join_template.pt b/skins/customer_join_template.pt index 7799f6f..acbf54c 100644 --- a/skins/customer_join_template.pt +++ b/skins/customer_join_template.pt @@ -2,7 +2,7 @@ -
@@ -69,6 +69,34 @@
+ + +

Accès à des images privées

+ veuillez entrer le code d'accès pour accéder / acheter les images
+ d'un événement privé couvert par les photographes de notre agence. + + + + Identifiant collection privée + + + + + + Mot de passe associé + + + + + + Confirmation du mot de passe + + + + + +
+

Billing informations

diff --git a/skins/customer_login_form.pt b/skins/customer_login_form.pt index d5fc2e5..7e9b601 100644 --- a/skins/customer_login_form.pt +++ b/skins/customer_login_form.pt @@ -4,7 +4,7 @@ - +
diff --git a/skins/validatePrivateAccess.py b/skins/validatePrivateAccess.py new file mode 100755 index 0000000..19e3a7d --- /dev/null +++ b/skins/validatePrivateAccess.py @@ -0,0 +1,16 @@ +##parameters=**kw +kg = lambda name : kw.get(name,'').strip() + +weddingId = kg('wedding_id') +if not weddingId : + return True + +else : + password = kg('wedding_password') + confirm = kg('wedding_password_confirm') + memberId = kg('member_id') + msg = context.grantAccess(context, weddingId, password, confirm, memberId) + if msg : + return context.setStatus(False, msg) + else : + return True -- 2.20.1