X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/773a32c20340b63d244d2a43d6fd62103e723bc5..02643dc71034e01a60f505cdc0887ae79314a3ed:/skins/generic/request_password_reset_form.py diff --git a/skins/generic/request_password_reset_form.py b/skins/generic/request_password_reset_form.py index 69a34c3..a08d980 100644 --- a/skins/generic/request_password_reset_form.py +++ b/skins/generic/request_password_reset_form.py @@ -1,13 +1,19 @@ -##parameters=userid='', requestReset='' +##parameters=userid='', requestReset='', ajax='' from Products.CMFCore.utils import getUtilityByInterfaceName -from Products.Plinn.utils import Message as _ +from Products.Plinn.utils import translate + +_ = lambda msg : translate(msg, context) utool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IURLTool') rtool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IRegistrationTool') if requestReset : - uuid = rtool.requestPasswordReset(userid) - context.setStatus(True, _('request for resetting password sent')) - return 'yeah !' + msg = rtool.requestPasswordReset(userid) + if not msg : + context.setStatus(True, _('Request for resetting password sent to your contact email.')) + context.setRedirect(utool.getPortalObject(), 'object/view', ajax=ajax) + return + + context.setStatus(False, msg) options={} target = '%s/request_password_reset_form' % utool()