3 * Copyright 2004 (c) GForge LLC
4 * Copyright 2006 (c) Fabien Regnier - Sogeti
5 * Copyright 2010-2011, Franck Villaume - Capgemini
7 * This file is part of FusionForge.
9 * FusionForge is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 require_once '../../env.inc.php';
25 require_once $gfcommon.'include/pre.php';
27 $user = session_get_user(); // get the session user
29 if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
30 exit_error("Invalid User", "Cannot Process your request for this user.");
33 $type = getStringFromRequest('type');
34 $projectsHierarchy = plugin_get_object('projects-hierarchy');
37 exit_error("Cannot Process your request: No TYPE specified", 'home'); // you can create items in Base.tab and customize this messages
42 if (!session_loggedin()) {
45 $id = getStringFromRequest('id');
47 exit_error("Cannot Process your request: No ID specified", 'home');
49 $group = group_get_object($id);
51 exit_error("Invalid Project", 'home');
53 if (!$group->usesPlugin($projectsHierarchy->name)) {//check if the group has the projects-hierarchy plugin active
54 exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'), $projectsHierarchy->name), 'home');
56 session_require_perm('project_admin', $id);
58 $action = getStringFromRequest('action');
62 case "projectsHierarchyDocman":
65 case "validateRelationship": {
66 include($gfplugins.$projectsHierarchy->name.'/actions/'.$action.'.php');
70 $projectsHierarchy->redirect($_SERVER['HTTP_REFERER'], 'error_msg', _('Unknown action.'));
77 if (!session_loggedin()) {
80 session_require_global_perm('forge_admin');
81 $action = getStringFromRequest('action');
83 case 'updateGlobalConf': {
85 include($gfplugins.$projectsHierarchy->name.'/actions/'.$action.'.php');
89 $projectsHierarchy->getHeader('globaladmin');
90 $projectsHierarchy->getGlobalAdminView();
91 $projectsHierarchy->getFooter('globaladmin');
95 if (!session_loggedin()) {
98 $id = getStringFromRequest('group_id');
99 session_require_perm('project_admin', $id);
101 exit_error("Cannot Process your request: No ID specified", 'home');
103 $group = group_get_object($id);
105 exit_error("Invalid Project", 'home');
107 if (!$group->usesPlugin($projectsHierarchy->name)) {//check if the group has the projects-hierarchy plugin active
108 exit_error(sprintf(_('First activate the %s plugin through the Project\'s Admin Interface'), $projectsHierarchy->name), 'home');
110 $action = getStringFromRequest('action');
112 case 'updateProjectConf': {
114 include($gfplugins.$projectsHierarchy->name.'/actions/'.$action.'.php');
118 // params needed by site_project_header() inside getHeader()
120 'toptab' => $projectsHierarchy->name,
122 $projectsHierarchy->getHeader('admin', $params);
123 $projectsHierarchy->getProjectAdminView();
124 $projectsHierarchy->getFooter('admin');
128 exit_error("No TYPE specified", 'home');
135 // c-file-style: "bsd"