/** * Returns the list of websites ID with the 'view' or 'admin' access for the current user. * For the superUser it returns all the websites in the database. * * @return array list of websites ID */ public function getSitesIdWithAtLeastViewAccess($_restrictSitesToLogin = false) { if (!empty($_restrictSitesToLogin) && Piwik_TaskScheduler::isTaskBeingExecuted()) { $accessRaw = Piwik_Access::getRawSitesWithSomeViewAccess($_restrictSitesToLogin); $sitesId = array(); foreach ($accessRaw as $access) { $sitesId[] = $access['idsite']; } return $sitesId; } else { return Zend_Registry::get('access')->getSitesIdWithAtLeastViewAccess(); } }