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
1
Merge Requests
1
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
Boxiang Sun
erp5
Commits
017770a1
Commit
017770a1
authored
Mar 12, 2015
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web: First draft managing Balancer Cookie
parent
f773dd54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_login.xml
.../SkinTemplateItem/portal_skins/erp5_web/WebSite_login.xml
+4
-3
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_logout.xml
...SkinTemplateItem/portal_skins/erp5_web/WebSite_logout.xml
+4
-0
No files found.
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_login.xml
View file @
017770a1
...
@@ -45,17 +45,18 @@
...
@@ -45,17 +45,18 @@
came_from python: request.get(\'came_from\') or request.get(\'field_came_from\');\n
came_from python: request.get(\'came_from\') or request.get(\'field_came_from\');\n
isAnon here/portal_membership/isAnonymousUser|nothing;"
>
\n
isAnon here/portal_membership/isAnonymousUser|nothing;"
>
\n
<tal:block
tal:condition=
"isAnon"
>
\n
<tal:block
tal:condition=
"isAnon"
>
\n
<tal:block
tal:define=
"dummy python: response.expireCookie(\'__ac\', path=\'/\');\n
<tal:block
tal:define=
"dummy python: response.expireCookie(request.getHeader(\'HTTP_X_BALANCER_CURRENT_COOKIE\', \'\'), path=\'/\');\n
dummy python: response.expireCookie(\'__ac\', path=\'/\');\n
url python: \'%s/login_form?portal_status_message=%s\' % (here.absolute_url(), here.Base_translateString(\'Login and/or password is incorrect.\'));\n
url python: \'%s/login_form?portal_status_message=%s\' % (here.absolute_url(), here.Base_translateString(\'Login and/or password is incorrect.\'));\n
url python: came_from and \'%s&came_from=%s\' % (url, came_from) or url;\n
url python: came_from and \'%s&came_from=%s\' % (url, came_from) or url;\n
dummy python: response.redirect(url);"
/>
\n
dummy python: response.redirect(url);"
/>
\n
</tal:block>
\n
</tal:block>
\n
<tal:block
tal:condition=
"not: isAnon"
>
\n
<tal:block
tal:condition=
"not: isAnon"
>
\n
<tal:block
tal:define=
"dummy python: response.setCookie(request.getHeader(\'HTTP_X_BALANCER_CURRENT_COOKIE\', \'\'), request.getHeader(\'HTTP_X_BALANCER_CURRENT_SERVER\', \'\'), path=\'/\');"
/>
\n
<tal:block
tal:define=
"dummy python: response.redirect(came_from or here.getPermanentURL(here));"
/>
\n
<tal:block
tal:define=
"dummy python: response.redirect(came_from or here.getPermanentURL(here));"
/>
\n
</tal:block>
\n
</tal:block>
\n
</tal:block>
\n
</tal:block>
\n
</tal:block>
\n
</tal:block>
]]>
</unicode>
</value>
]]>
</unicode>
</value>
</item>
</item>
...
...
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_logout.xml
View file @
017770a1
...
@@ -177,6 +177,10 @@ website = context.getWebSiteValue()\n
...
@@ -177,6 +177,10 @@ website = context.getWebSiteValue()\n
REQUEST = context.REQUEST\n
REQUEST = context.REQUEST\n
if REQUEST.has_key(\'portal_skin\'):\n
if REQUEST.has_key(\'portal_skin\'):\n
context.portal_skins.clearSkinCookie()\n
context.portal_skins.clearSkinCookie()\n
\n
balancer_cookie = REQUEST.getHeader(\'HTTP_X_BALANCER_CURRENT_COOKIE\', \'\')\n
if balancer_cookie:\n
REQUEST.RESPONSE.expireCookie(balancer_cookie, path=\'/\')\n
REQUEST.RESPONSE.expireCookie(\'__ac\', path=\'/\')\n
REQUEST.RESPONSE.expireCookie(\'__ac\', path=\'/\')\n
msg = context.Base_translateString(\'You have been logged out. Thank you for using this website.\')\n
msg = context.Base_translateString(\'You have been logged out. Thank you for using this website.\')\n
return website.Base_redirect(form_id, keep_items = {\'portal_status_message\' : msg}, **kw)\n
return website.Base_redirect(form_id, keep_items = {\'portal_status_message\' : msg}, **kw)\n
...
...
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