Commit f4c94450 authored by Ivan Tyagov's avatar Ivan Tyagov

Add new preference which allow site admin control process of asking

security question (default is ask).
parent c58dfe13
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</item> </item>
<item> <item>
<key> <string>last_id</string> </key> <key> <string>last_id</string> </key>
<value> <string>2</string> </value> <value> <string>3</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/boolean</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>If set will ask the specified during account creation security question when doing a password recover. </string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>preferred_ask_credential_question_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>preference</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>write_permission</string> </key>
<value> <string>Manage properties</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
\n \n
request = context.REQUEST\n request = context.REQUEST\n
request.set(\'reference\', reference)\n request.set(\'reference\', reference)\n
portal = context.getPortalObject()\n
portal_preferences = context.portal_preferences\n
\n \n
person_module = context.getDefaultModule(\'Person\')\n person_module = context.getDefaultModule(\'Person\')\n
result = person_module.searchFolder(reference=reference)\n result = person_module.searchFolder(reference=reference)\n
...@@ -69,13 +71,16 @@ person = result[0]\n ...@@ -69,13 +71,16 @@ person = result[0]\n
#If any question, we can create directly the credential recovery\n #If any question, we can create directly the credential recovery\n
question_free_text = person.getDefaultCredentialQuestionQuestionFreeText()\n question_free_text = person.getDefaultCredentialQuestionQuestionFreeText()\n
question_title = person.getDefaultCredentialQuestionQuestionTitle()\n question_title = person.getDefaultCredentialQuestionQuestionTitle()\n
if not (question_free_text or question_title):\n \n
if not (question_free_text or question_title) or \\\n
not portal_preferences.isPreferredAskCredentialQuestion():\n
return context.ERP5Site_newCredentialRecovery(reference=reference)\n return context.ERP5Site_newCredentialRecovery(reference=reference)\n
\n \n
return context.Base_redirect(\'ERP5Site_newCredentialRecoveryDialog\', keep_items = \\\n return context.Base_redirect(\'ERP5Site_newCredentialRecoveryDialog\', \n
dict(default_credential_question_question_free_text=question_free_text,\n keep_items = \\\n
default_credential_question_question_title=question_title,\n dict(default_credential_question_question_free_text=question_free_text,\n
reference=reference))\n default_credential_question_question_title=question_title,\n
reference=reference))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -63,6 +63,7 @@ def createCredentialRecovery(**kw):\n ...@@ -63,6 +63,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
person_module = portal.getDefaultModule(\'Person\')\n person_module = portal.getDefaultModule(\'Person\')\n
result = person_module.searchFolder(reference=reference)\n result = person_module.searchFolder(reference=reference)\n
if len(result) != 1:\n if len(result) != 1:\n
...@@ -86,7 +87,8 @@ if (question_title or question_free_text) and (answer == question_answer):\n ...@@ -86,7 +87,8 @@ if (question_title or question_free_text) and (answer == question_answer):\n
default_credential_question_answer=default_credential_question_answer,\n default_credential_question_answer=default_credential_question_answer,\n
destination_decision=person.getRelativeUrl(),\n destination_decision=person.getRelativeUrl(),\n
language=portal.Localizer.get_selected_language())\n language=portal.Localizer.get_selected_language())\n
elif question_free_text is None and question_answer is None:\n elif (question_free_text is None and question_answer is None) or \\\n
not portal_preferences.isPreferredAskCredentialQuestion():\n
createCredentialRecovery(reference=reference,\n createCredentialRecovery(reference=reference,\n
destination_decision=person.getRelativeUrl(),\n destination_decision=person.getRelativeUrl(),\n
language=portal.Localizer.get_selected_language())\n language=portal.Localizer.get_selected_language())\n
......
...@@ -109,7 +109,6 @@ if portal_preferences.getPreferredCredentialAlarmAutomaticCall():\n ...@@ -109,7 +109,6 @@ if portal_preferences.getPreferredCredentialAlarmAutomaticCall():\n
credential_request.submit("Automatic submit")\n credential_request.submit("Automatic submit")\n
message_str = "Credential Request Created."\n message_str = "Credential Request Created."\n
else:\n else:\n
context.log(\'--- %s \' %portal_preferences.isPreferredEmailVerificationCheck())\n
if portal_preferences.isPreferredEmailVerificationCheck():\n if portal_preferences.isPreferredEmailVerificationCheck():\n
# Send email to subscriber in order to check email\'s address\n # Send email to subscriber in order to check email\'s address\n
credential_request.activate(activity=\'SQLQueue\').CredentialRequest_sendSubmittedNotification(\n credential_request.activate(activity=\'SQLQueue\').CredentialRequest_sendSubmittedNotification(\n
......
...@@ -81,16 +81,10 @@ ...@@ -81,16 +81,10 @@
<key> <string>center</string> </key> <key> <string>center</string> </key>
<value> <value>
<list> <list>
<string>my_preferred_credential_request_automatic_approval</string>
<string>my_preferred_organisation_credential_update_automatic_approval</string>
<string>my_preferred_credential_recovery_automatic_approval</string>
<string>my_preferred_person_credential_update_automatic_approval</string>
<string>my_preferred_credential_alarm_automatic_call</string>
<string>my_preferred_credential_assignment_duration</string> <string>my_preferred_credential_assignment_duration</string>
<string>my_preferred_login_and_password_notifier</string> <string>my_preferred_login_and_password_notifier</string>
<string>my_preferred_subscription_assignment_category_list</string> <string>my_preferred_subscription_assignment_category_list</string>
<string>my_preferred_credential_contract_document_reference</string> <string>my_preferred_credential_contract_document_reference</string>
<string>my_preferred_email_verification_check</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -103,13 +97,22 @@ ...@@ -103,13 +97,22 @@
<item> <item>
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list/> <list>
<string>my_preferred_credential_request_automatic_approval</string>
<string>my_preferred_organisation_credential_update_automatic_approval</string>
<string>my_preferred_credential_recovery_automatic_approval</string>
<string>my_preferred_person_credential_update_automatic_approval</string>
<string>my_preferred_credential_alarm_automatic_call</string>
</list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
<list/> <list>
<string>my_preferred_ask_credential_question</string>
<string>my_preferred_email_verification_check</string>
</list>
</value> </value>
</item> </item>
</dictionary> </dictionary>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_preferred_ask_credential_question</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Ask Security Question</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
378 379
\ No newline at end of file \ 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