/** * Answer true if this site should be included * * @param object Id $id * @return boolean * @access protected * @since 4/1/08 */ protected function includeSite(Id $id) { // If the site isn't visible, don't bother checking edit AZs if (!parent::includeSite($id)) { return false; } $authZ = Services::getService("AuthZ"); $idManager = Services::getService("Id"); if ($authZ->isUserAuthorizedBelow($idManager->getId("edu.middlebury.authorization.modify"), $id)) { return TRUE; } else { return FALSE; } }
/** * Run the update * * @return boolean * @access public * @since 3/24/08 */ function runUpdate() { $agentMgr = Services::getService('Agent'); $idMgr = Services::getService('Id'); $groupType = new Type("System", "edu.middlebury.harmoni", "ApplicationGroups", ""); $nullType = new Type("System", "edu.middlebury.harmoni", "NULL"); $nullProperties = new HarmoniProperties($nullType); try { $containerGroup = $agentMgr->getGroup($idMgr->getId('edu.middlebury.segue.site-members')); } catch (UnknownIdException $e) { $containerGroup = $agentMgr->createGroup('Site-Members', $groupType, 'A container for site-membership groups', $nullProperties, $idMgr->getId('edu.middlebury.segue.site-members')); } // Since updates can only be run by admins, which in turn can see all sites, // the all visible folder will get all slots. $folder = new AllVisiblePortalFolder(); $slots = $folder->getSlots(); $status = new StatusStars(_("Checking Nodes")); $status->initializeStatistics(count($slots)); $director = SiteDispatcher::getSiteDirector(); foreach ($slots as $slot) { $site = $director->getSiteComponentById($slot->getSiteId()->getIdString()); $site->getMembersGroup(); $status->updateStatistics(); } return $this->isInPlace(); }