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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
b3fa0428
Commit
b3fa0428
authored
Oct 16, 2020
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_xhtml_style: Fix logged_in handling of came_from when authentication failed.
Also, modernise it a bit.
parent
d98bb397
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/logged_in.py
...inTemplateItem/portal_skins/erp5_xhtml_style/logged_in.py
+16
-7
No files found.
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/logged_in.py
View file @
b3fa0428
...
...
@@ -4,14 +4,23 @@ if portal.portal_skins.updateSkinCookie():
url
=
REQUEST
.
get
(
"came_from"
)
if
portal
.
portal_membership
.
isAnonymousUser
():
RESPONSE
.
expireCookie
(
"__ac"
,
path
=
"/"
)
url
=
"%s/login_form?portal_status_message=%s"
%
(
context
.
absolute_url
(),
context
.
Base_translateString
(
"Login and/or password is incorrect."
)
+
(
"&came_from="
+
url
if
url
else
""
))
elif
not
url
:
keep_item_dict
=
{
'portal_status_message'
:
context
.
Base_translateString
(
"Login and/or password is incorrect."
),
}
if
url
:
keep_item_dict
[
'came_from'
]
=
url
context
.
Base_redirect
(
form_id
=
'login_form'
,
keep_items
=
keep_item_dict
,
)
return
if
not
url
:
url
=
context
.
absolute_url
()
topmost_url_document
=
context
.
Base_getURLTopmostDocumentValue
()
if
not
topmost_url_document
.
isURLAncestorOf
(
url
):
return
context
.
ERP5Site_redirect
(
topmost_url_document
.
absolute_url
(),
keep_items
=
{
'portal_status_message'
:
'Redirection to an external site prevented.'
})
return
topmost_url_document
.
Base_redirect
(
keep_items
=
{
'portal_status_message'
:
context
.
Base_translateString
(
'Redirection to an external site prevented.'
),
}
)
return
RESPONSE
.
redirect
(
url
)
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