Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
7dd043a7
Commit
7dd043a7
authored
Jul 21, 2011
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure no more than set in preferences authentication failures are
saved. Add comment.
parent
8e37853d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
product/ERP5/tests/testAuthenticationPolicy.py
product/ERP5/tests/testAuthenticationPolicy.py
+5
-0
product/ERP5Security/ERP5UserManager.py
product/ERP5Security/ERP5UserManager.py
+1
-0
No files found.
product/ERP5/tests/testAuthenticationPolicy.py
View file @
7dd043a7
...
...
@@ -110,6 +110,11 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
# file two more failures so we should detect and block account
self
.
assertEqual
(
2
,
len
(
person
.
notifyLoginFailure
()))
self
.
assertEqual
(
3
,
len
(
person
.
notifyLoginFailure
()))
# we do not need to store more than max allowed failures so check it here
# this way a bot can not brute force us by filling up session storage backend
for
i
in
range
(
0
,
1000
):
self
.
assertEqual
(
3
,
len
(
person
.
notifyLoginFailure
()))
#import pdb; pdb.set_trace()
self
.
assertTrue
(
person
.
isLoginBlocked
())
...
...
product/ERP5Security/ERP5UserManager.py
View file @
7dd043a7
...
...
@@ -179,6 +179,7 @@ class ERP5UserManager(BasePlugin):
return
authentication_result
# authentication policy enabled, we need person object anyway
# XXX: every request is a MySQL call
user_list
=
self
.
getUserByLogin
(
credentials
.
get
(
'login'
))
if
not
user_list
:
# not an ERP5 Person object
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment