Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
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
Eteri
erp5_fork
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 @@
"""
from
DateTime
import
DateTime
from
Products.ZSQLCatalog.SQLCatalog
import
Query
from
erp5.component.module.Log
import
log
request
=
context
.
REQUEST
portal
=
context
.
getPortalObject
()
...
...
@@ -17,6 +18,13 @@ one_second = 1/24.0/60.0/60.0
check_duration
=
portal_preferences
.
getPreferredAuthenticationFailureCheckDuration
()
block_duration
=
portal_preferences
.
getPreferredAuthenticationFailureBlockDuration
()
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
# 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