def __call__(self): if self.request.REQUEST_METHOD == 'POST' and self.request.form.get( 'id'): session_id = self.request.form.get('id') user_id = self.request.form.get('userid') user = api.user.get(user_id) sm = SessionManager(self.context, self.request, user) sm.session_id = session_id sm.expire() self.sessions = get_active_sessions() return super(SessionsView, self).__call__()
def __call__(self): alsoProvides(self.request, IBlocksTransformEnabled) self.site = api.portal.get() if (self.request.REQUEST_METHOD == 'POST' and self.request.form.get('removesession') == 'yes'): session_id = self.request.form.get('id') user = api.user.get_current() sm = SessionManager(api.portal.get(), self.request, user) sm.session_id = session_id sm.expire() self._user_cache = {} self.pas_member = getMultiAdapter((self.site, self.request), name=u"pas_member") self.util = getMultiAdapter((self.site, self.request), name="castle-utils") self.sessions = self.get_open_sessions() self.has_add_permission = api.user.has_permission('Add portal content', obj=self.site) return self