Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
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
Show 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
...
@@ -111,6 +111,11 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
...
@@ -111,6 +111,11 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
self
.
assertEqual
(
2
,
len
(
person
.
notifyLoginFailure
()))
self
.
assertEqual
(
2
,
len
(
person
.
notifyLoginFailure
()))
self
.
assertEqual
(
3
,
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()
#import pdb; pdb.set_trace()
self
.
assertTrue
(
person
.
isLoginBlocked
())
self
.
assertTrue
(
person
.
isLoginBlocked
())
...
...
product/ERP5Security/ERP5UserManager.py
View file @
7dd043a7
...
@@ -179,6 +179,7 @@ class ERP5UserManager(BasePlugin):
...
@@ -179,6 +179,7 @@ class ERP5UserManager(BasePlugin):
return
authentication_result
return
authentication_result
# authentication policy enabled, we need person object anyway
# authentication policy enabled, we need person object anyway
# XXX: every request is a MySQL call
user_list
=
self
.
getUserByLogin
(
credentials
.
get
(
'login'
))
user_list
=
self
.
getUserByLogin
(
credentials
.
get
(
'login'
))
if
not
user_list
:
if
not
user_list
:
# not an ERP5 Person object
# 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