Commit c8f9394b authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_web: First draft managing Balancer Cookie

parent 908dafe0
...@@ -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&amp;came_from=%s\' % (url, came_from) or url;\n url python: came_from and \'%s&amp;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>
......
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment