Commit 036b1b64 authored by Jérome Perrin's avatar Jérome Perrin

authentication: fixup renaming of Person_unblockLogin -> Login_unblockLogin

parent a64dc42d
No related merge requests found
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/Person_unblockLogin</string> </value> <value> <string>string:${object_url}/Login_unblockLogin</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -23,18 +23,19 @@ kw = {'portal_type': 'Authentication Event', ...@@ -23,18 +23,19 @@ kw = {'portal_type': 'Authentication Event',
'validation_state' : 'confirmed'} 'validation_state' : 'confirmed'}
failure_list = portal.portal_catalog(**kw) failure_list = portal.portal_catalog(**kw)
for failure in failure_list: for failure in failure_list:
person = failure.getDestinationValue() login = failure.getDestinationValue()
if person not in all_blocked_user_login_dict.keys(): if login not in all_blocked_user_login_dict.keys():
all_blocked_user_login_dict[person] = [] all_blocked_user_login_dict[login] = []
all_blocked_user_login_dict[person].append(failure) all_blocked_user_login_dict[login].append(failure)
# leave only ones that are blocked: # leave only ones that are blocked:
for person, failure_list in all_blocked_user_login_dict.items(): for login, failure_list in all_blocked_user_login_dict.items():
if len(failure_list) >= max_authentication_failures: if len(failure_list) >= max_authentication_failures:
blocked_user_login_list.append(newTempBase(portal, person = login.getParentValue()
person.getTitle(), blocked_user_login_list.append(newTempBase(portal,
person.getTitle(),
**{'title': person.getTitle(), **{'title': person.getTitle(),
'count':len(failure_list), 'count':len(failure_list),
'reference': person.Person_getUserId(), 'reference': login.getReference(),
'url': person.absolute_url()})) 'url': login.absolute_url()}))
return blocked_user_login_list return blocked_user_login_list
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
python: \'<a title="Click to unblock login" href="%s/Person_unblockLogin?cancel_url=%s"> Unblock </a>\' %(cell.url, here.absolute_url()) python: \'<a title="Click to unblock login" href="%s/Login_unblockLogin?cancel_url=%s"> Unblock </a>\' %(cell.url, here.absolute_url())
]]></string> </value> ]]></string> </value>
</item> </item>
......
Person | unblock_user_login ERP5 Login | 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