Commit 8c967107 authored by Jérome Perrin's avatar Jérome Perrin

km: remove password management features that are now handled by erp5_credentials

parent fd1cec20
<?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>"""\n
Sets a new password for a Person\n
sends notification by invoking Person_sendPasswordNotification\n
"""\n
translateString = context.Base_translateString\n
\n
# create password\n
password = context.Person_generatePassword(alpha=8, numeric=2)\n
context.setPassword(password)\n
context.Person_sendPasswordNotification(about=\'password_reset\', password=password)\n
\n
msg = translateString(\'Password reset.\')\n
return context.Base_redirect(form_id, keep_items = {\'portal_status_message\' : msg}, **kw)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>dialog_id=None, form_id=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Person_resetPassword</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""\n
XXX\n
Good idea. Please ask sebastien what we use for that in other \n
parts of ERP5. If needed, make it a standard feature in \n
erp5_base or even a standard method of Person class.\n
\n
Notification is something very generic which sometimes\n
involves preferences (ex. notify me on my SMS email\n
if urgent, etc.)\n
XXX: Use portal_notifications instead of direct email sending.\n
\n
"""\n
\n
translateString = context.Base_translateString\n
login = context.getReference()\n
mto = context.getDefaultEmailText()\n
mfrom = context.getPortalObject().email_from_address\n
subject = \'Your ERP5 Account\'\n
messageTemplate = \'\'\n
\n
if about == \'validation\':\n
messageTemplate = """\n
Your ERP5 Account has just been validated.\n
\n
username: ${login}\n
password: ${password}\n
\n
Enjoy!\n
""" \n
\n
if about == \'password_reset\':\n
messageTemplate = """\n
Your password for ERP5 Account has just been set.\n
\n
username: ${login}\n
password: ${password}\n
\n
Enjoy!\n
"""\n
\n
if messageTemplate == \'\':\n
raise Exception(\'the "about" argument of %s was not in the allowed range - I was unable to generate a meaningful message\' % about)\n
\n
messageText = translateString(messageTemplate, mapping=dict(login=login, password=password))\n
\n
# send email\n
context.MailHost.send(messageText, mto, mfrom, subject)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>about, password=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Person_sendPasswordNotification</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>reset_password</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Reset Password</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Person_resetPassword</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Person | reset_password
Person | web_view
\ 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