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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
erp5
Commits
67c311d5
Commit
67c311d5
authored
Apr 28, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Add support for erp5_authentication_policy messages
parent
5be40cad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebSite_login.py
...teItem/portal_skins/erp5_web_renderjs_ui/WebSite_login.py
+19
-2
No files found.
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebSite_login.py
View file @
67c311d5
...
@@ -13,10 +13,27 @@ portal.setupCurrentSkin(REQUEST)
...
@@ -13,10 +13,27 @@ portal.setupCurrentSkin(REQUEST)
if
(
portal
.
portal_membership
.
isAnonymousUser
()):
if
(
portal
.
portal_membership
.
isAnonymousUser
()):
RESPONSE
.
expireCookie
(
'__ac'
,
path
=
'/'
)
RESPONSE
.
expireCookie
(
'__ac'
,
path
=
'/'
)
url
=
'%s/login_form?portal_status_message=%s'
%
(
context
.
absolute_url
(),
context
.
Base_translateString
(
'Login and/or password is incorrect.'
))
url
=
came_from
and
'%s&came_from=%s'
%
(
url
,
came_from
)
or
url
;
is_user_account_blocked
=
REQUEST
.
get
(
'is_user_account_blocked'
,
False
)
is_user_account_password_expired
=
REQUEST
.
get
(
'is_user_account_password_expired'
,
False
)
if
is_user_account_blocked
:
message
=
context
.
Base_translateString
(
'Account is blocked.'
)
elif
is_user_account_password_expired
:
if
(
portal
.
portal_preferences
.
isPreferredSystemRecoverExpiredPassword
()):
message
=
context
.
Base_translateString
(
'Password is expired. You will soon receive an email with details about how you can recover it.'
)
else
:
message
=
context
.
Base_translateString
(
'Password is expired.'
)
else
:
message
=
context
.
Base_translateString
(
'Login and/or password is incorrect.'
)
url
=
'%s/login_form?portal_status_message=%s'
%
(
context
.
absolute_url
(),
message
)
url
=
came_from
and
'%s&came_from=%s'
%
(
url
,
came_from
)
or
url
RESPONSE
.
redirect
(
url
)
RESPONSE
.
redirect
(
url
)
else
:
else
:
# XXX How to warn user that password will expire?
# is_user_account_password_expired_expire_date = REQUEST.get('is_user_account_password_expired_expire_date', 0)
# XXX Hardcoded behaviour for JS app.
# XXX Hardcoded behaviour for JS app.
# Expect came_from to be an URL template
# Expect came_from to be an URL template
person
=
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
()
...
...
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