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
Frederic Thoma
erp5
Commits
a31eab5f
Commit
a31eab5f
authored
Jul 10, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_authentication_policy: force user to change password if not yet do
parent
f5f322a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
bt5/erp5_authentication_policy/SkinTemplateItem/portal_skins/erp5_authentication_policy/Login_isPasswordExpired.py
...ins/erp5_authentication_policy/Login_isPasswordExpired.py
+7
-0
No files found.
bt5/erp5_authentication_policy/SkinTemplateItem/portal_skins/erp5_authentication_policy/Login_isPasswordExpired.py
View file @
a31eab5f
...
@@ -25,6 +25,13 @@ if password_event_list:
...
@@ -25,6 +25,13 @@ if password_event_list:
password_lifetime_expire_warning_duration
=
portal_preferences
.
getPreferredPasswordLifetimeExpireWarningDuration
()
password_lifetime_expire_warning_duration
=
portal_preferences
.
getPreferredPasswordLifetimeExpireWarningDuration
()
if
password_lifetime_expire_warning_duration
and
now
>
expire_date
-
password_lifetime_expire_warning_duration
*
ONE_HOUR
:
if
password_lifetime_expire_warning_duration
and
now
>
expire_date
-
password_lifetime_expire_warning_duration
*
ONE_HOUR
:
expire_date_warning
=
expire_date
expire_date_warning
=
expire_date
else
:
# No Password Event found means user doesn't yet change password
# Force user to change it if authentication policy is configured
if
portal
.
portal_preferences
.
getPreferredMaxPasswordLifetimeDuration
()
is
not
None
:
if
context
.
getPassword
():
is_password_expired
=
True
request
=
portal
.
REQUEST
request
=
portal
.
REQUEST
request
.
set
(
'is_user_account_password_expired'
,
is_password_expired
)
request
.
set
(
'is_user_account_password_expired'
,
is_password_expired
)
request
.
set
(
'is_user_account_password_expired_expire_date'
,
expire_date_warning
)
request
.
set
(
'is_user_account_password_expired_expire_date'
,
expire_date_warning
)
...
...
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