from zope.publisher.browser import BrowserPage from zope.app.pagetemplate import ViewPageTemplateFile from zope.app.security.interfaces import IUnauthenticatedPrincipal from zope.app.component.hooks import getSite from zope.traversing.browser import absoluteURL class MemberFolderIndex(BrowserPage): template = ViewPageTemplateFile('member_folder_index.pt') def __call__(self): request = self.request if (IUnauthenticatedPrincipal.providedBy(request.principal)): site = getSite() site_url = absoluteURL(site, request) request.response.redirect(site_url) else: return self.template()