[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - ZopePublication.py:1.13

Itamar Shtull-Trauring zope@itamarst.org
Fri, 6 Dec 2002 08:12:41 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication
In directory cvs.zope.org:/tmp/cvs-serv5098/App/ZopePublication

Modified Files:
	ZopePublication.py 
Log Message:
update IAuthenticateService for requirements of generic implementation

=== Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py 1.12 => 1.13 ===
--- Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py:1.12	Mon Nov 11 09:15:44 2002
+++ Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py	Fri Dec  6 08:12:09 2002
@@ -71,14 +71,14 @@
     def beforeTraversal(self, request):
 
         # Try to authenticate against the default global registry.
-        id = prin_reg.authenticate(request)
-        if id is None:
-            id = prin_reg.unauthenticatedPrincipal()
-            if id is None:
+        p = prin_reg.authenticate(request)
+        if p is None:
+            p = prin_reg.unauthenticatedPrincipal()
+            if p is None:
                 raise Unauthorized # If there's no default principal
 
-        newSecurityManager(id)
-        request.user = prin_reg.getPrincipal(id)
+        newSecurityManager(p.getId())
+        request.user = p
         get_transaction().begin()
 
     def _maybePlacefullyAuthenticate(self, request, ob):
@@ -104,15 +104,15 @@
             return
 
         # Try to authenticate against the auth service
-        id = auth_service.authenticate(request)
-        if id is None:
-            id = auth_service.unauthenticatedPrincipal()
-            if id is None:
+        principal = auth_service.authenticate(request)
+        if principal is None:
+            principal = auth_service.unauthenticatedPrincipal()
+            if principal is None:
                 # nothing to do here
                 return
 
-        newSecurityManager(id)
-        request.user = auth_service.getPrincipal(id)
+        newSecurityManager(principal.getId())
+        request.user = principal
         
 
     def callTraversalHooks(self, request, ob):