public function unarchive_project_page($ctl) { if (!empty($_REQUEST['p'])) { if (is_array($_REQUEST['p']) || preg_match('/[^\\w\\_\\-]/', $_REQUEST['p'])) { return trigger_error("Please don't hack...", E_USER_ERROR); } $project = new Ansible__Project($_REQUEST['p'], $ctl->stage, true); if ($project->exists() && $project->archived()) { $user = !empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : '******'; $project->unarchive($user); } } $ctl->redirect('../list.php?cat=archived'); exit; }
public function project() { require_once dirname(dirname(dirname(__FILE__))) . '/Project.class.php'; $project = new Ansible__Project($this->project, $GLOBALS['controller']->stage, false); return $project->exists() ? $project : null; }
public function get_projects_from_param($param) { require_once $this->config('lib_path') . '/Ansible/Project.class.php'; $projects = array(); foreach ((array) $param as $p) { $project = new Ansible__Project($p, $this); if (!$project->exists()) { return trigger_error("Invalid project: " . $p, E_USER_ERROR); } $projects[] = $project; } return $projects; }