[Checkins]
SVN: zope.app.exception/trunk/src/zope/app/exception/browser/unauthorized.py
Substitute zope.app.zapi by direct calls to its wrapped apis.
See bug 219302
Lorenzo Gil
lgs at sicem.biz
Mon Apr 21 14:23:52 EDT 2008
Log message for revision 85562:
Substitute zope.app.zapi by direct calls to its wrapped apis. See bug 219302
Changed:
U zope.app.exception/trunk/src/zope/app/exception/browser/unauthorized.py
-=-
Modified: zope.app.exception/trunk/src/zope/app/exception/browser/unauthorized.py
===================================================================
--- zope.app.exception/trunk/src/zope/app/exception/browser/unauthorized.py 2008-04-21 18:19:53 UTC (rev 85561)
+++ zope.app.exception/trunk/src/zope/app/exception/browser/unauthorized.py 2008-04-21 18:23:52 UTC (rev 85562)
@@ -19,9 +19,9 @@
from zope.publisher.browser import BrowserPage
from zope.formlib import namedtemplate
-
-from zope.app import zapi
+from zope.component import getUtility
from zope.app.pagetemplate import ViewPageTemplateFile
+from zope.app.security.interfaces import IAuthentication
class Unauthorized(BrowserPage):
@@ -29,14 +29,14 @@
# Set the error status to 403 (Forbidden) in the case when we don't
# challenge the user
self.request.response.setStatus(403)
-
+
# make sure that squid does not keep the response in the cache
self.request.response.setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT')
self.request.response.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate')
self.request.response.setHeader('Pragma', 'no-cache')
principal = self.request.principal
- auth = zapi.principals()
+ auth = getUtility(IAuthentication)
auth.unauthorized(principal.id, self.request)
if self.request.response.getStatus() not in (302, 303):
return self.template()
More information about the Checkins
mailing list