[Zope-CVS] CVS: Products/PluggableAuthService - PluggableAuthService.py:1.13

Lennart Regebro regebro at nuxeo.com
Mon Sep 13 12:57:42 EDT 2004


Update of /cvs-repository/Products/PluggableAuthService
In directory cvs.zope.org:/tmp/cvs-serv9340

Modified Files:
	PluggableAuthService.py 
Log Message:
Implementing challenge plugin support via __before_traverse_hook_ 


=== Products/PluggableAuthService/PluggableAuthService.py 1.12 => 1.13 ===
--- Products/PluggableAuthService/PluggableAuthService.py:1.12	Wed Sep  8 14:02:21 2004
+++ Products/PluggableAuthService/PluggableAuthService.py	Mon Sep 13 12:57:11 2004
@@ -1088,17 +1088,22 @@
 
     def __call__(self, container, req):
         """ The __before_publishing_traverse__ hook. """
-        # resp = self.REQUEST['RESPONSE']
-
-        # plugins = self._getOb('plugins')
-
-        # challengers = plugins.listPlugins( IChallengePlugin )
-
-        # for challenger_id, challenger in challengers:
-        #     challenger.challenge(req, resp)
-
+        resp = req['RESPONSE']
+        resp.old_unauthorized = resp._unauthorized
+        resp._unauthorized = self.challenge
         return
 
+    def challenge(self):
+        req = self.REQUEST
+        resp = req['RESPONSE']
+        resp.old_unauthorized()
+        
+        # Go through all challenge plugins
+        plugins = self._getOb('plugins')
+        challengers = plugins.listPlugins( IChallengePlugin )
+        for challenger_id, challenger in challengers:
+            challenger.challenge(req, resp)
+        
     security.declarePublic( 'hasUsers' )
     def hasUsers(self):
         """Zope quick start sacrifice.



More information about the Zope-CVS mailing list