[Erp5-report] r38905 fabien - in /experimental/bt5/erp5_credential: SkinTemplateItem/portal...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 6 09:28:19 CEST 2010


Author: fabien
Date: Wed Oct  6 09:28:17 2010
New Revision: 38905

URL: http://svn.erp5.org?rev=38905&view=rev
Log:
add manager proxy role and redirect on login_form.
add a condition for credential_automatic_accept_interraction_workflowscripts/CredentialRecovery_preferredApprovalMethod to be sure that the preference is enable before to accept.

Modified:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_getRelatedCredentialQuestionDialog.xml
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newCredentialRecovery.xml
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/CredentialRecovery_preferredApprovalMethod.xml
    experimental/bt5/erp5_credential/bt/revision

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_getRelatedCredentialQuestionDialog.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_getRelatedCredentialQuestionDialog.xml?rev=38905&r1=38904&r2=38905&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_getRelatedCredentialQuestionDialog.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_getRelatedCredentialQuestionDialog.xml [utf8] Wed Oct  6 09:28:17 2010
@@ -50,14 +50,19 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>request  = context.REQUEST\n
+            <value> <string>\'\'\'\n
+  Try to find the question related to the user passed in parameter.\n
+  Proxy : this required a manager proxy role to be able to search in all persons\n
+\'\'\'\n
+\n
+request  = context.REQUEST\n
 request.set(\'reference\', reference)\n
 \n
 person_module = context.getDefaultModule(\'Person\')\n
 result = person_module.searchFolder(reference=reference)\n
 if len(result) != 1:\n
   portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n
-  return context.Base_redirect(\'\', keep_items = dict(portal_status_message=portal_status_message ))\n
+  return context.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
 \n
 person = result[0]\n
 return context.Base_redirect(\'ERP5Site_newCredentialRecoveryDialog\', keep_items = \\\n
@@ -77,6 +82,14 @@ dict(default_credential_question_questio
             <value> <string>reference=None, **kw</string> </value>
         </item>
         <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
             <key> <string>errors</string> </key>
             <value>
               <tuple/>

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newCredentialRecovery.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newCredentialRecovery.xml?rev=38905&r1=38904&r2=38905&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newCredentialRecovery.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newCredentialRecovery.xml [utf8] Wed Oct  6 09:28:17 2010
@@ -50,14 +50,19 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>person_module = context.getDefaultModule(\'Person\')\n
+            <value> <string>\'\'\'\n
+  This script is used to create the new credential recovery\n
+  Proxy : Manager proxy role is required to make possible for \n
+anonymous to create a new Credential Recovery\n
+\'\'\'\n
+\n
+person_module = context.getDefaultModule(\'Person\')\n
 result = person_module.searchFolder(reference=reference)\n
 if len(result) != 1:\n
   portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n
   return context.Base_redirect(\'\', keep_items = dict(portal_status_message=portal_status_message ))\n
 \n
 person = result[0].getObject()\n
-\n
 # create the credential recovery\n
 module = context.getDefaultModule(portal_type=\'Credential Recovery\')\n
 credential_recovery = module.newContent(\n
@@ -70,7 +75,7 @@ credential_recovery.setDestinationDecisi
 credential_recovery.submit()\n
 \n
 portal_status_message = context.Base_translateString("Credential Recovery Created.")\n
-return context.Base_redirect(\'\', keep_items = dict(portal_status_message=portal_status_message ))\n
+return context.Base_redirect(\'login_form\', keep_items = dict(portal_status_message=portal_status_message ))\n
 </string> </value>
         </item>
         <item>
@@ -86,7 +91,9 @@ return context.Base_redirect(\'\', keep_
         <item>
             <key> <string>_proxy_roles</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
             </value>
         </item>
         <item>

Modified: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/CredentialRecovery_preferredApprovalMethod.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/CredentialRecovery_preferredApprovalMethod.xml?rev=38905&r1=38904&r2=38905&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/CredentialRecovery_preferredApprovalMethod.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/CredentialRecovery_preferredApprovalMethod.xml [utf8] Wed Oct  6 09:28:17 2010
@@ -55,18 +55,19 @@ When the password is changed, this mean 
 should be accepted.\n
 \'\'\'\n
 portal = state_change.getPortal()\n
-person = state_change[\'object\']\n
 \n
-credential_recovery_module = portal.getDefaultModule(\'Credential Recovery\')\n
+if portal.portal_preferences.getPreferredCredentialRecoveryAutomaticApproval():\n
+  person = state_change[\'object\']\n
 \n
-# get all submitted credential recoveries for this user\n
-result = credential_recovery_module.searchFolder(portal_type=\'Credential Recovery\',\n
-                                                 destination_decision_uid=person.getUid(),\n
-                                                 validation_state=\'submitted\')\n
+  credential_recovery_module = portal.getDefaultModule(\'Credential Recovery\')\n
 \n
-# and accept them all\n
-for credential_recovery in result:\n
-  credential_recovery.getObject().accept("Automatic accept")\n
+  # get all submitted credential recoveries for this user\n
+  result = credential_recovery_module.searchFolder(portal_type=\'Credential Recovery\',\n
+                                                   destination_decision_uid=person.getUid(),\n
+                                                   validation_state=\'submitted\')\n
+  # and accept them all\n
+  for credential_recovery in result:\n
+    credential_recovery.getObject().accept("Automatic accept")\n
 </string> </value>
         </item>
         <item>
@@ -82,7 +83,9 @@ for credential_recovery in result:\n
         <item>
             <key> <string>_proxy_roles</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
             </value>
         </item>
         <item>

Modified: experimental/bt5/erp5_credential/bt/revision
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/bt/revision?rev=38905&r1=38904&r2=38905&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/bt/revision [utf8] (original)
+++ experimental/bt5/erp5_credential/bt/revision [utf8] Wed Oct  6 09:28:17 2010
@@ -1 +1 @@
-256
\ No newline at end of file
+258
\ No newline at end of file




More information about the Erp5-report mailing list