Commit ac404fd7 authored by Kevin Deldycke's avatar Kevin Deldycke

Klaus : Patch CookieCrumbler to remove "?came_from" from getLoginUrl (called...

Klaus : Patch CookieCrumbler to remove "?came_from" from getLoginUrl (called by request.unauthorized).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3892 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 021ef0d0
......@@ -1977,3 +1977,27 @@ try:
AttrDict.has_key = AttrDict_has_key
except ImportError:
pass
############################################################################
#CookieCrumbler: remove "?came_from" from getLoginUrl (called by request.unauthorized)
from Products.CMFCore.CookieCrumbler import CookieCrumbler
class PatchedCookieCrumbler(CookieCrumbler):
def getLoginURL(self):
'''
Redirects to the login page.
'''
if self.auto_login_page:
req = self.REQUEST
resp = req['RESPONSE']
iself = getattr(self, 'aq_inner', self)
parent = getattr(iself, 'aq_parent', None)
page = getattr(parent, self.auto_login_page, None)
if page is not None:
retry = getattr(resp, '_auth', 0) and '1' or ''
url = '%s?retry=%s&disable_cookie_login__=1' % (
page.absolute_url(), retry)
return url
return None
CookieCrumbler.getLoginURL=PatchedCookieCrumbler.getLoginURL
\ No newline at end of file
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