Commit ee64d50c authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

patches/CookieCrumbler: update patch for CMF 2.3

ICookieCrumbler.credentialsChanged signature changed in Products.CMFCore
2.3.0-beta. We also update the patch on the same occasion.
parent 77c1c67e
...@@ -176,12 +176,21 @@ def modifyRequest(self, req, resp): ...@@ -176,12 +176,21 @@ def modifyRequest(self, req, resp):
CookieCrumbler.modifyRequest = modifyRequest CookieCrumbler.modifyRequest = modifyRequest
def credentialsChanged(self, user, name, pw): def credentialsChanged(self, user, name, pw, request=None):
ac = standard_b64encode('%s:%s' % (name, pw)) """
method = self.getCookieMethod( 'setAuthCookie' Updates cookie credentials if user details are changed.
, self.defaultSetAuthCookie ) """
resp = self.REQUEST['RESPONSE'] if request is None:
method( resp, self.auth_cookie, quote( ac ) ) request = getRequest() # BBB for Membershiptool
reponse = request['RESPONSE']
# <patch>
# We don't want new lines, so use base64.standard_b64encode instead of
# base64.encodestring
ac = standard_b64encode('%s:%s' % (name, pw)).rstrip()
# </patch>
method = self.getCookieMethod('setAuthCookie',
self.defaultSetAuthCookie)
method(reponse, self.auth_cookie, quote(ac))
CookieCrumbler.credentialsChanged = credentialsChanged CookieCrumbler.credentialsChanged = credentialsChanged
......
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