Commit 162cf1c4 authored by Ivan Tyagov's avatar Ivan Tyagov

Add action to unblock user login.

parent 0b952f6c
<?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>Unblock User Account</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>unblock_user_login</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>25.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Unblock User Login</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_unblockLogin</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
\n \n
if not context.ERP5Site_isAuthenticationPolicyEnabled():\n if not portal.ERP5Site_isAuthenticationPolicyEnabled():\n
# no policy, no sense to block account\n # no policy, no sense to block account\n
return 0\n return 0\n
\n \n
...@@ -60,11 +60,14 @@ key = \'authentication_failure_list\'\n ...@@ -60,11 +60,14 @@ key = \'authentication_failure_list\'\n
session_id = context.Person_getAuthenticationSessionId()\n session_id = context.Person_getAuthenticationSessionId()\n
session = portal.portal_sessions[session_id]\n session = portal.portal_sessions[session_id]\n
session[key] = []\n session[key] = []\n
if not batch_mode:\n
message = context.Base_translateString(\'User Login unblocked.\')\n
context.Base_redirect(form_id=form_id, keep_items={\'portal_status_message\': message})\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>form_id, batch_mode=False</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
5 6
\ No newline at end of file \ No newline at end of file
Person | unblock_user_login
System Preference | authentication_policy System Preference | authentication_policy
\ 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