diff --git a/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_updatePersonPassword.xml b/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_updatePersonPassword.xml index 96dad832072467600f63e53514d139905452bde4..2727ec7afde11899ee7220d1b50ddb5d9d3dfc76 100644 --- a/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_updatePersonPassword.xml +++ b/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_updatePersonPassword.xml @@ -64,6 +64,14 @@ if context.getPassword():\n <key> <string>_params</string> </key> <value> <string></string> </value> </item> + <item> + <key> <string>_proxy_roles</string> </key> + <value> + <tuple> + <string>Manager</string> + </tuple> + </value> + </item> <item> <key> <string>id</string> </key> <value> <string>Credential_updatePersonPassword</string> </value> diff --git a/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newPersonCredentialUpdate.xml b/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newPersonCredentialUpdate.xml index 65c42e607a899bab25f3b3acd3ab775b90bb88bf..bceb45308f478f235a3c125ddf84c73e66e0eb74 100644 --- a/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newPersonCredentialUpdate.xml +++ b/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newPersonCredentialUpdate.xml @@ -55,7 +55,7 @@ portal = context.getPortalObject()\n person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n \n if person is None:\n - portal_status_message = context.Base_translateString("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 # create the credential update\n module = context.getDefaultModule(portal_type=\'Credential Update\')\n @@ -89,10 +89,18 @@ else:\n credential_update.edit(password=password)\n \n credential_update.submit()\n + portal_status_message = "Credential Update Created."\n \n - portal_status_message = context.Base_translateString("Credential Update Created.")\n + # if we are changing password for current logged in user then do it\n + # within same transaction and update client side credentials cookie \n + username = person.getReference()\n + if password and username == str(portal.portal_membership.getAuthenticatedMember()):\n + credential_update.accept()\n + portal.cookie_authentication.credentialsChanged(username, username, password)\n + portal_status_message = "Password changed."\n \n -return portal.Base_redirect(keep_items = {\'portal_status_message\': 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 </string> </value> </item> <item> diff --git a/bt5/erp5_credential/bt/revision b/bt5/erp5_credential/bt/revision index e41567feb87fd40d6e88e91674e66a77a5074304..1380537bfd769da6c47bce5c91a7c45a57e7df7c 100644 --- a/bt5/erp5_credential/bt/revision +++ b/bt5/erp5_credential/bt/revision @@ -1 +1 @@ -384 \ No newline at end of file +385 \ No newline at end of file