public function searchAllowedProjects() { $project_manager = $this->project_manager; return $this->dao->searchAllowedProjectsOnResource(self::RESOURCE_ID)->instanciateWith(function ($row) use($project_manager) { return $project_manager->getProjectFromDbRow($row); }); }
$gr = new Group(1); $fusionforgeproject = $gr->getUnixName(); } $exppath = explode('/', $_SERVER['PHP_SELF']); # determine $fusionforgeproject from the URL while (count($exppath) >= 4) { if ($exppath[0] == 'plugins' && $exppath[1] == 'mediawiki' && $exppath[2] == 'wiki' && in_array($exppath[4], array('api.php', 'index.php', 'load.php'))) { $fusionforgeproject = $exppath[3]; break; } else { array_shift($exppath); } } if (!isset($is_tuleap_mediawiki_123)) { $is_tuleap_mediawiki_123 = false; $restrictor_dao = new MediawikiSiteAdminResourceRestrictorDao(); if ($restrictor_dao->isMediawiki123(MediawikiSiteAdminResourceRestrictor::RESOURCE_ID, $fusionforgeproject)) { $is_tuleap_mediawiki_123 = true; } } $IP = '/usr/share/mediawiki-tuleap'; if ($is_tuleap_mediawiki_123) { $IP = '/usr/share/mediawiki-tuleap-123'; } $group = group_get_object_by_name($fusionforgeproject); $gconfig_dir = forge_get_config('mwdata_path', 'mediawiki'); $project_dir = forge_get_config('projects_path', 'mediawiki') . "/" . $group->getID(); if (!is_dir($project_dir)) { $project_dir = forge_get_config('projects_path', 'mediawiki') . "/" . $group->getUnixName(); if (!is_dir($project_dir)) { exit_error(sprintf(_('Mediawiki for project %s not created yet, please wait for a few minutes.'), $group->getPublicName() . ' : ' . $project_dir));
<?php require_once 'common/Config/LocalIncFinder.php'; $locar_inc_finder = new Config_LocalIncFinder(); $local_inc = $locar_inc_finder->getLocalIncPath(); require_once $local_inc; require_once $GLOBALS['db_config_file']; require_once 'common/dao/CodendiDataAccess.class.php'; require_once 'common/dao/include/DataAccessObject.class.php'; require_once 'common/Config/ForgeConfig.php'; require_once __DIR__ . '/../include/MediawikiSiteAdminResourceRestrictor.php'; $dao = new MediawikiSiteAdminResourceRestrictorDao(); $uri = explode('/', $_SERVER['REQUEST_URI']); if (file_exists('/usr/share/mediawiki-tuleap-123') && $dao->isMediawiki123(MediawikiSiteAdminResourceRestrictor::RESOURCE_ID, $uri[4])) { $mediawikipath = '/usr/share/mediawiki-tuleap-123'; } else { $mediawikipath = '/usr/share/mediawiki-tuleap'; }