Commit 1e684a2e authored by Kevin Deldycke's avatar Kevin Deldycke

Move Klaus CookieCrumbler patch from ZopePatch to CMFCorePatch


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3896 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 80ce1e9d
......@@ -327,3 +327,25 @@ ActionProviderBase.manage_editActionsForm = ActionProviderBase_manage_editAction
ActionProviderBase.addAction = ActionProviderBase_addAction
ActionProviderBase._extractAction = ActionProviderBase_extractAction
############################################################################
#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
......@@ -1977,27 +1977,3 @@ 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