Commit d5442e7d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Cédric Le Ninivin

erp5_core, erp5_base : move change password action and form from erp5_core to erp5_base.

parent 73e08c0b
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
if person is None:\n
return []\n
else:\n
return [x.getReference() for x in person.objectValues(portal_type=portal_type) \\\n
if x.getValidationState() == \'validated\']\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>portal_type=\'ERP5 Login\'</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>Base_getValidatedLoginReferenceList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -56,11 +56,13 @@ from Products.ERP5Type.Message import translateString\n
portal = context.getPortalObject()\n
user = getSecurityManager().getUser()\n
person = context.acl_users.erp5_users.getPersonByReference(user.getId())\n
login = portal.restrictedTraverse(login)\n
if login.getParentValue() != person:\n
msg = translateString(\'You can change your own password only.\')\n
for login in person.objectValues(portal_type=\'ERP5 Login\'):\n
if login.getReference() == reference and login.getValidationState() == \'validated\':\n
break\n
else:\n
msg = translateString(\'You cannot change the password for %r.\' % reference)\n
return context.Base_redirect(dialog_id, keep_items=dict(portal_status_message=msg))\n
elif not login.checkPassword(current_password):\n
if not login.checkPassword(current_password):\n
msg = translateString("Current password is wrong.")\n
return context.Base_redirect(dialog_id, keep_items=dict(portal_status_message=msg))\n
\n
......@@ -72,7 +74,7 @@ return portal.Base_redirect(\'logout\')\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>new_password, current_password, login, dialog_id=\'view\', **kw</string> </value>
<value> <string>new_password, current_password, reference, dialog_id=\'view\', **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......
......@@ -87,7 +87,7 @@
<key> <string>left</string> </key>
<value>
<list>
<string>your_login</string>
<string>your_reference</string>
<string>your_current_password</string>
<string>your_new_password</string>
<string>password_confirm</string>
......
......@@ -18,7 +18,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_login</string> </value>
<value> <string>your_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -68,10 +68,18 @@
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -119,7 +127,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/Base_getValidatedLoginItemList</string> </value>
<value> <string>python: [(x, x) for x in here.Base_getValidatedLoginReferenceList()]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -80,6 +80,7 @@ Person | person_detailed_report
Person | terminate_career
Person | view
Preference | base_preference
Preference | change_password
Previous Causality Movement Group | view
Property Assignment Movement Group | view
Property Grouping Movement Group | view
......
......@@ -23,7 +23,6 @@ Attribute Unicity Constraint | view
Base Category | view
Base Domain | view
Base Type | action_view
Base Type | jump_property_sheets
Base Type | role_view
Base Type | translation_view
Base Type | update_local_roles
......@@ -80,17 +79,14 @@ Id Tool | view
Memcached Plugin | view
Memcached Tool | view
Predicate | view
Preference Tool Type | jump_property_sheets
Preference Tool Type | view
Preference Tool | advanced
Preference Tool | view
Preference Type | action_view
Preference Type | jump_property_sheets
Preference Type | role_view
Preference Type | translation_view
Preference Type | update_local_roles
Preference Type | view
Preference | change_password
Preference | html_style_preferences
Preference | view
Preference | view_template
......
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