Commit f4e37cf7 authored by Ivan Tyagov's avatar Ivan Tyagov

Always redirect to root ERP5 Site and whenever an anonymous user is

requesting a new account or resetting a password to respective
login_form.
parent 2482d35c
No related merge requests found
......@@ -57,6 +57,7 @@ mail_message = portal.portal_catalog.getResultValue(portal_type="Mail Message",
credential_request = mail_message.getFollowUpValue()\n
\n
credential_request.submit(comment=\'Create by subscription form\')\n
\n
mail_message.deliver()\n
message = "Your account is being activated. You will receive one e-mail after finish the activation"\n
return context.Base_redirect("login_form?portal_status_message=%s" % message)\n
......
......@@ -58,7 +58,7 @@ anonymous to create a new Credential Recovery\n
def createCredentialRecovery(**kw):\n
module = portal.getDefaultModule(portal_type=\'Credential Recovery\')\n
credential_recovery = module.newContent(\n
\t\tportal_type="Credential Recovery",\n
portal_type="Credential Recovery",\n
**kw)\n
credential_recovery.submit()\n
\n
......@@ -80,7 +80,6 @@ answer = default_credential_question_answer and default_credential_question_answ
\n
keep_items = {}\n
message = "Credential Recovery Created."\n
dialog_id = dialog_id or "login_form"\n
\n
if (question_title or question_free_text) and (answer == question_answer):\n
createCredentialRecovery(reference=reference,\n
......@@ -98,7 +97,7 @@ else:\n
\'reference\': reference}\n
\n
keep_items[\'portal_status_message\'] = portal.Base_translateString(message)\n
return context.Base_redirect(dialog_id, keep_items=keep_items)\n
portal.Base_redirect(form_id=\'login_form\', keep_items=keep_items)\n
</string> </value>
</item>
<item>
......
......@@ -55,17 +55,17 @@ Paramameter list :\n
reference -- User login is mandatory (String)\n
default_email_text -- Email is mandatory (String)"""\n
# create the credential request\n
portal = context.getPortalObject()\n
module = context.getDefaultModule(portal_type=\'Credential Request\')\n
portal_preferences = context.portal_preferences\n
category_list = portal_preferences.getPreferredSubscriptionAssignmentCategoryList()\n
\n
if not context.CredentialRequest_checkLoginAvailability(reference):\n
message_str = "Selected login is already in use, please choose different one."\n
return context.Base_redirect(dialog_id,\n
keep_items = dict(portal_status_message=context.Base_translateString(message_str)))\n
return portal.Base_redirect(keep_items = dict(portal_status_message=context.Base_translateString(message_str)))\n
\n
credential_request = module.newContent(\n
\t\tportal_type="Credential Request",\n
portal_type="Credential Request",\n
first_name=first_name,\n
last_name=last_name,\n
reference=reference,\n
......@@ -115,8 +115,8 @@ else:\n
notification_reference=\'erp5-subscription.notification\')\n
message_str = "Thanks for your registration. You will be receive an email to activate your account."\n
\n
return context.Base_redirect(dialog_id,\n
keep_items = dict(portal_status_message=context.Base_translateString(message_str)))\n
portal.Base_redirect(form_id=\'login_form\', \n
keep_items = dict(portal_status_message=context.Base_translateString(message_str)))\n
</string> </value>
</item>
<item>
......
......@@ -51,6 +51,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""Create a credential update in relation with the person object of current user"""\n
portal = context.getPortalObject()\n
person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n
if person is None:\n
......@@ -91,8 +92,7 @@ else:\n
\n
portal_status_message = context.Base_translateString("Credential Update Created.")\n
\n
return context.Base_redirect(dialog_id, \n
keep_items = {\'portal_status_message\': portal_status_message})\n
portal.Base_redirect(keep_items = {\'portal_status_message\': portal_status_message})\n
</string> </value>
</item>
<item>
......
376
\ No newline at end of file
377
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment