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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
d6186232
Commit
d6186232
authored
Oct 17, 2022
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_authentication_policy: Add a log message if preference is missing.
parent
88ee0cb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
bt5/erp5_authentication_policy/SkinTemplateItem/portal_skins/erp5_authentication_policy/Login_isLoginBlocked.py
..._skins/erp5_authentication_policy/Login_isLoginBlocked.py
+8
-0
No files found.
bt5/erp5_authentication_policy/SkinTemplateItem/portal_skins/erp5_authentication_policy/Login_isLoginBlocked.py
View file @
d6186232
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
"""
"""
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ZSQLCatalog.SQLCatalog
import
Query
from
Products.ZSQLCatalog.SQLCatalog
import
Query
from
erp5.component.module.Log
import
log
request
=
context
.
REQUEST
request
=
context
.
REQUEST
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
...
@@ -17,6 +18,13 @@ one_second = 1/24.0/60.0/60.0
...
@@ -17,6 +18,13 @@ one_second = 1/24.0/60.0/60.0
check_duration
=
portal_preferences
.
getPreferredAuthenticationFailureCheckDuration
()
check_duration
=
portal_preferences
.
getPreferredAuthenticationFailureCheckDuration
()
block_duration
=
portal_preferences
.
getPreferredAuthenticationFailureBlockDuration
()
block_duration
=
portal_preferences
.
getPreferredAuthenticationFailureBlockDuration
()
max_authentication_failures
=
portal_preferences
.
getPreferredMaxAuthenticationFailure
()
max_authentication_failures
=
portal_preferences
.
getPreferredMaxAuthenticationFailure
()
if
None
in
(
check_duration
,
block_duration
,
max_authentication_failures
):
log
(
'Login block is not working because authentication policy in system preference is not set properly.'
)
return
0
check_time
=
now
-
check_duration
*
one_second
check_time
=
now
-
check_duration
*
one_second
# some failures might be still unindexed
# some failures might be still unindexed
...
...
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