from Globals import InitializeClass from Products.Five import BrowserView as BaseView from zope.component import getUtility from Products.iFolio.interfaces import IAffordanceManager, IUsersManager from AccessControl.SecurityInfo import ClassSecurityInfo from AccessControl import getSecurityManager class iFolioView(BaseView): """ iFolio View """ security = ClassSecurityInfo() def getYUIBase(self): #return "http://yheksa.htk.tlu.ee/~vahur/yui/build" return "http://www.htk.tlu.ee/~vahur/yui/yui/build" def listUsers(self): um = getUtility(IUsersManager) users = um._listUsers() res = [] for x in users: res.append([x.id, x.getTitle()]) #return [['vahur', 'Vahur Rebas'], ['pjotr', 'Pjotr Savitski']] return res def isLoggedIn(self): u = getSecurityManager().getUser() if u is None or u.getUserName() == 'Anonymous User': return 0 return 1 InitializeClass(iFolioView)