[Zope-CVS] CVS: Products/CookieCrumbler - CookieCrumbler.py:1.22

Shane Hathaway shane at zope.com
Thu Feb 5 10:35:46 EST 2004


Update of /cvs-repository/Products/CookieCrumbler
In directory cvs.zope.org:/tmp/cvs-serv1370

Modified Files:
	CookieCrumbler.py 
Log Message:
Added the twiddleAuthCookie feature from CMF.


=== Products/CookieCrumbler/CookieCrumbler.py 1.21 => 1.22 ===
--- Products/CookieCrumbler/CookieCrumbler.py:1.21	Thu Jan 22 11:41:00 2004
+++ Products/CookieCrumbler/CookieCrumbler.py	Thu Feb  5 10:35:15 2004
@@ -120,8 +120,8 @@
 
     # Allow overridable cookie set/expiration methods.
     security.declarePrivate('getCookieMethod')
-    def getCookieMethod( self, name='setAuthCookie', default=None ):
-        return getattr( self.aq_inner.aq_parent, name, default )
+    def getCookieMethod(self, name, default=None):
+        return getattr(self, name, default)
 
     security.declarePrivate('defaultSetAuthCookie')
     def defaultSetAuthCookie( self, resp, cookie_name, cookie_value ):
@@ -195,6 +195,10 @@
                         req._auth = 'Basic %s' % ac
                         resp._auth = 1
                         self.delRequestVar(req, self.auth_cookie)
+                        method = self.getCookieMethod(
+                            'twiddleAuthCookie', None)
+                        if method is not None:
+                            method(resp, self.auth_cookie, quote(ac))
 
         req._cookie_auth = attempt
         return attempt
@@ -403,4 +407,3 @@
             addDTMLMethod(ob, fn, file=data)
     if REQUEST is not None:
         return dispatcher.manage_main(dispatcher, REQUEST)
-




More information about the Zope-CVS mailing list