Implémentation complète (mais minimale) de la réinitialisation de mot de passe.
[Plinn.git] / skins / generic / password_reset_form.py
diff --git a/skins/generic/password_reset_form.py b/skins/generic/password_reset_form.py
new file mode 100644 (file)
index 0000000..b783b63
--- /dev/null
@@ -0,0 +1,19 @@
+##parameters=validate=''
+from Products.CMFCore.utils import getUtilityByInterfaceName
+utool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IURLTool')
+atool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IActionsTool')
+
+form = context.REQUEST.form
+uuid = traverse_subpath[0]
+
+if validate and \
+    context.validatePassword(**form) and \
+    context.reset_password_control(uuid=uuid, **form) and \
+    context.setRedirect(atool, 'user/join', ajax=form.get('ajax')) :
+    return
+
+options = {}
+options['uuid'] = uuid
+options['action'] = '%s/password_reset_form/%s' % (utool(), uuid)
+
+return context.password_reset_template(**options)
\ No newline at end of file