3 * Site Admin group properties editing page
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2010 (c) Franck Villaume - Capgemini
7 * Copyright (C) 2011-2012 Alain Peyrat - Alcatel-Lucent
8 * Copyright 2013, French Ministry of National Education
9 * Copyright 2013, Franck Villaume - TrivialDev
11 * This file is part of FusionForge. FusionForge is free software;
12 * you can redistribute it and/or modify it under the terms of the
13 * GNU General Public License as published by the Free Software
14 * Foundation; either version 2 of the Licence, or (at your option)
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 require_once '../env.inc.php';
28 require_once $gfcommon.'include/pre.php';
29 require_once $gfwww.'admin/admin_utils.php';
30 require_once $gfwww.'project/admin/project_admin_utils.php';
34 session_require_global_perm ('forge_admin');
36 $group_id = getIntFromRequest('group_id');
37 $group = group_get_object($group_id);
38 if (!$group || !is_object($group)) {
40 } elseif ($group->isError()) {
41 exit_error($group->getErrorMessage(),'admin');
44 // This function performs every update
45 function do_update(&$group, $is_template, $status, $unix_box, $http_domain, $scm_box='') {
51 if (!$group->setStatus(session_get_user(), $status)) {
52 $error_msg .= $group->getErrorMessage();
57 if (!$group->updateAdmin(session_get_user(), $unix_box, $http_domain)) {
58 $error_msg .= $group->getErrorMessage();
63 if (!$group->setAsTemplate($is_template)) {
64 $error_msg .= $group->getErrorMessage();
69 if($group->usesSCM() && !$group->setSCMBox($scm_box)) {
70 $error_msg .= $group->getErrorMessage();
76 $feedback .= _('Updated');
81 if (getStringFromRequest('submit')) {
82 $form_template = getStringFromRequest('form_template');
83 $form_status = getStringFromRequest('form_status');
84 $form_box = getStringFromRequest('form_box');
85 $form_domain = getStringFromRequest('form_domain');
86 $form_scm_box = getStringFromRequest('form_scm_box');
88 do_update($group, $form_template, $form_status, $form_box, $form_domain, $form_scm_box);
90 } elseif (getStringFromRequest('resend')) {
92 $group->sendApprovalEmail();
93 $feedback .= _('Instruction email sent');
97 $title = _('Site Admin')._(': ')._('Project Info for ') . $group->getPublicName();
98 site_admin_header(array('title'=>$title));
101 <h2><?php echo util_make_link("/project/admin/?group_id=$group_id", _('Project Admin')); ?></h2>
102 <h2><?php echo util_make_link("/admin/groupdelete.php?group_id=$group_id", _('Permanently Delete Project')); ?></h2>
104 echo $HTML->openForm(array('action' => '/admin/groupedit.php?group_id='.$group_id, 'method' => 'post'));
107 <table class="infotable">
110 <?php echo _('Status')._(':'); ?>
113 <?php // PLEASE DO NOT TRANSLATE THIS, THIS IS DATABASE INFO THAT CANNOT BE DIFFERENT AMONG LANGUAGES
114 $status = $group->getStatus();
116 // we cannot update the status of a pending project
117 echo '<input type="hidden" name="form_status" value="P" />';
118 echo _('Pending (P)').' ';
120 echo html_build_select_box_from_arrays(
133 'form_status', $status, false
139 <td colspan="2"><?php
140 printf(_('With PFO-RBAC, the “is_public” property is gone. Instead, to make a project public, <%1$s>link<%2$s> the global role “Anonymous/not logged in” then <%3$s>give<%4$s> it “Project visibility” permissions.'),
141 'a href="' . util_make_url('/project/admin/users.php?group_id=' .
144 'a href="' . util_make_url('/project/admin/roleedit.php?group_id=' .
145 $group_id . '&role_id=' . RoleAnonymous::getInstance()->getID()) . '"',
153 <?php echo _('Template?')._(':'); ?>
157 echo html_build_select_box_from_arrays(
166 'form_template', $group->isTemplate(), false
173 <?php echo _('Project Unix Name')._(':'); ?>
176 <?php echo $group->getUnixName(); ?>
181 if (forge_get_config('use_shell')) {
185 <?php echo _('Home Box')._(':'); ?>
188 <input type="text" name="form_box" value="<?php echo $group->getUnixBox(); ?>" />
195 <label for="form_domain"><?php echo _('HTTP Domain')._(':') ?></label>
198 <input size="40" id="form_domain" type="text" name="form_domain" value="<?php echo $group->getDomain(); ?>" />
204 <?php echo _('Registration Application')._(':'); ?>
207 <?php echo $group->getRegistrationPurpose(); ?>
211 if ($group->usesSCM()) {
214 <td><?php echo _('SCM Box')._(':'); ?></td>
215 <td><input size="40" type="text" name="form_scm_box" value="<?php echo $group->getSCMBox(); ?>"/></td>
223 <input type="hidden" name="group_id" value="<?php print $group_id; ?>" />
225 <br /><input type="submit" name="submit" value="<?php echo _('Update'); ?>" />
226 <input type="submit" name="resend" value="<?php echo _('Resend New Project Instruction Email'); ?>" />
229 echo $HTML->closeForm();
230 show_grouphistory($group->getID());
236 // c-file-style: "bsd"