Commit 19708a88 authored by Jérome Perrin's avatar Jérome Perrin

get scripts from portal

parent de0a9cca
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
Proxy : this required a manager proxy role to be able to search in all persons\n Proxy : this required a manager proxy role to be able to search in all persons\n
\'\'\'\n \'\'\'\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
person_module = context.getDefaultModule(\'Person\')\n person_module = portal.getDefaultModule(\'Person\')\n
if choice == "password":\n if choice == "password":\n
request = context.REQUEST\n request = context.REQUEST\n
request.set(\'reference\', reference)\n request.set(\'reference\', reference)\n
......
...@@ -64,7 +64,7 @@ def createCredentialRecovery(**kw):\n ...@@ -64,7 +64,7 @@ def createCredentialRecovery(**kw):\n
credential_recovery.submit()\n credential_recovery.submit()\n
\n \n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
portal_preferences = context.portal_preferences\n portal_preferences = portal.portal_preferences\n
keep_items = {}\n keep_items = {}\n
\n \n
if default_email_text is not None:\n if default_email_text is not None:\n
...@@ -73,8 +73,8 @@ if default_email_text is not None:\n ...@@ -73,8 +73,8 @@ if default_email_text is not None:\n
query_kw = {"email.url_string" : default_email_text}\n query_kw = {"email.url_string" : default_email_text}\n
result = portal.portal_catalog(portal_type="Email", parent_portal_type="Person", **query_kw)\n result = portal.portal_catalog(portal_type="Email", parent_portal_type="Person", **query_kw)\n
if len(result) == 0:\n if len(result) == 0:\n
portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n portal_status_message = portal.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n
return context.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n return portal.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
\n \n
person_list = [x.getObject().getParentValue() for x in result]\n person_list = [x.getObject().getParentValue() for x in result]\n
\n \n
......
...@@ -56,8 +56,8 @@ reference -- User login is mandatory (String)\n ...@@ -56,8 +56,8 @@ reference -- User login is mandatory (String)\n
default_email_text -- Email is mandatory (String)"""\n default_email_text -- Email is mandatory (String)"""\n
# create the credential request\n # create the credential request\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
module = context.getDefaultModule(portal_type=\'Credential Request\')\n module = portal.getDefaultModule(portal_type=\'Credential Request\')\n
portal_preferences = context.portal_preferences\n portal_preferences = portal.portal_preferences\n
category_list = portal_preferences.getPreferredSubscriptionAssignmentCategoryList()\n category_list = portal_preferences.getPreferredSubscriptionAssignmentCategoryList()\n
\n \n
if not context.CredentialRequest_checkLoginAvailability(reference):\n if not context.CredentialRequest_checkLoginAvailability(reference):\n
......
...@@ -52,13 +52,13 @@ ...@@ -52,13 +52,13 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Create a credential update in relation with the person object of current user"""\n <value> <string>"""Create a credential update in relation with the person object of current user"""\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n \n
if person is None:\n if person is None:\n
portal_status_message = "Can\'t find corresponding person, it\'s not possible to update your credentials."\n portal_status_message = "Can\'t find corresponding person, it\'s not possible to update your credentials."\n
else:\n else:\n
# create the credential update\n # create the credential update\n
module = context.getDefaultModule(portal_type=\'Credential Update\')\n module = portal.getDefaultModule(portal_type=\'Credential Update\')\n
credential_update = module.newContent(\n credential_update = module.newContent(\n
portal_type="Credential Update",\n portal_type="Credential Update",\n
first_name=first_name,\n first_name=first_name,\n
...@@ -99,7 +99,7 @@ else:\n ...@@ -99,7 +99,7 @@ else:\n
portal_status_message = "Password changed."\n portal_status_message = "Password changed."\n
\n \n
portal_status_message = context.Base_translateString(portal_status_message)\n portal_status_message = context.Base_translateString(portal_status_message)\n
portal.Base_redirect(keep_items = {\'portal_status_message\': portal_status_message})\n return portal.Base_redirect(keep_items = {\'portal_status_message\': portal_status_message})\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
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