Commit 26acca0e authored by Jérome Perrin's avatar Jérome Perrin

- clear corresponding cache after changing password

- translate message when redirecting

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24847 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 621baabc
......@@ -54,6 +54,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>from AccessControl import getSecurityManager\n
from Products.ERP5Type.Message import translateString\n
\n
request = context.REQUEST\n
new_password = request.get("new_password")\n
......@@ -64,14 +65,16 @@ persons = context.acl_users.erp5_users.getUserByLogin(user)\n
person = persons[0]\n
\n
if not person.checkPassword(former_password):\n
msg = "Current password is wrong."\n
msg = translateString("Current password is wrong.")\n
else:\n
msg = "Password changed."\n
msg = translateString("Password changed.")\n
person.setPassword(new_password)\n
\n
ret_url = \'/\'.join([context.absolute_url(), request.get(\'form_id\', \'view\')])\n
response = request.response\n
response.redirect("%s?portal_status_message=%s" % (ret_url, msg))\n
# clear erp5_content_short cache (see _authenticateCredentials in Products.ERP5Security.ERP5UserManager)\n
context.portal_caches.clearCache((\'erp5_content_short\',))\n
\n
return context.Base_redirect(form_id,\n
keep_items=dict(portal_status_message=msg))\n
</string> </value>
</item>
<item>
......@@ -82,7 +85,7 @@ response.redirect("%s?portal_status_message=%s" % (ret_url, msg))\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>form_id=\'view\', **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......@@ -110,15 +113,18 @@ response.redirect("%s?portal_status_message=%s" % (ret_url, msg))\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>form_id</string>
<string>kw</string>
<string>AccessControl</string>
<string>getSecurityManager</string>
<string>Products.ERP5Type.Message</string>
<string>translateString</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
......@@ -129,8 +135,7 @@ response.redirect("%s?portal_status_message=%s" % (ret_url, msg))\n
<string>_getitem_</string>
<string>person</string>
<string>msg</string>
<string>ret_url</string>
<string>response</string>
<string>dict</string>
</tuple>
</value>
</item>
......@@ -142,7 +147,9 @@ response.redirect("%s?portal_status_message=%s" % (ret_url, msg))\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
<tuple>
<string>view</string>
</tuple>
</value>
</item>
<item>
......
1033
\ No newline at end of file
1034
\ 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