From: Benoît Pin Date: Mon, 1 Sep 2014 18:50:28 +0000 (+0200) Subject: Mise à jour des templates / script pour les inscriptions client. X-Git-Url: https://svn.cri.ensmp.fr/git/photoprint.git/commitdiff_plain/4108abadea5456a9d832614c32b93925425f6904?ds=inline;hp=221f5fb59b37184372ba78fc765925758f5c0579 Mise à jour des templates / script pour les inscriptions client. --- 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