eggification
[photoprint.git] / Products / photoprint / skins / validatePrivateAccess.py
diff --git a/Products/photoprint/skins/validatePrivateAccess.py b/Products/photoprint/skins/validatePrivateAccess.py
new file mode 100755 (executable)
index 0000000..7fc6530
--- /dev/null
@@ -0,0 +1,17 @@
+##parameters=**kw
+from Products.photoprint.utils import grantAccess
+kg = lambda name : kw.get(name,'').strip()
+
+collectionId = kg('collection_id')
+if not collectionId :
+       return True
+
+else :
+       password = kg('collection_password')
+       confirm = kg('collection_password_confirm')
+       memberId = kg('member_id')
+       msg = grantAccess(collectionId, password, confirm, memberId)
+       if msg :
+               return context.setStatus(False, msg)
+       else :
+               return True