3 * Project Admin Main Page
5 * This page contains administrative information for the project as well
6 * as allows to manage it. This page should be accessible to all project
7 * members, but only admins may perform most functions.
9 * Copyright 2004 GForge, LLC
11 * @author Tim Perdue tim@gforge.org
13 * This file is part of GForge.
15 * GForge is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * GForge is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with GForge; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 require_once('../../env.inc.php');
31 require_once $gfwww.'include/pre.php';
32 require_once $gfwww.'include/role_utils.php';
33 require_once $gfwww.'project/admin/project_admin_utils.php';
34 require_once $gfcommon.'include/GroupJoinRequest.class.php';
36 $group_id = getIntFromRequest('group_id');
37 session_require(array('group'=>$group_id,'admin_flags'=>'A'));
39 // get current information
40 $group =& group_get_object($group_id);
41 if (!$group || !is_object($group)) {
42 exit_error('Error','Could Not Get Group');
43 } elseif ($group->isError()) {
44 exit_error('Error',$group->getErrorMessage());
47 $perm =& $group->getPermission( session_get_user() );
48 if (!$perm || !is_object($perm)) {
49 exit_error('Error','Could Not Get Permission');
50 } elseif ($perm->isError()) {
51 exit_error('Error',$perm->getErrorMessage());
54 if (!$perm->isAdmin()) {
55 exit_permission_denied();
60 $adminheadertitle=sprintf(_('Project Admin: %1$s'), $group->getPublicName() );
61 project_admin_header(array('title'=>$adminheadertitle, 'group'=>$group->getID()));
64 <table class="my-layout-table">
68 <?php echo $HTML->boxTop(_('Misc. Project Information')); ?>
72 global $sys_use_shell;
75 <p><?php echo _('Group shell (SSH) server: ') ?><strong><?php echo $group->getUnixName().'.'.forge_get_config('web_host'); ?></strong></p>
76 <p><?php echo _('Group directory on shell server: ') ?><br/><strong><?php echo account_group_homedir($group->getUnixName()); ?></strong></p>
77 <p><?php echo _('Project WWW directory on shell server: ') ?><br /><strong><?php echo account_group_homedir($group->getUnixName()).'/htdocs'; ?></strong></p>
79 } //end of use_shell condition
83 // If this was a submission, make updates
84 if (getStringFromRequest('submit')) {
85 $form_group_name = getStringFromRequest('form_group_name');
86 $form_shortdesc = getStringFromRequest('form_shortdesc');
87 $form_homepage = getStringFromRequest('form_homepage');
88 $logo_image_id = getIntFromRequest('logo_image_id');
89 $use_mail = getStringFromRequest('use_mail');
90 $use_survey = getStringFromRequest('use_survey');
91 $use_forum = getStringFromRequest('use_forum');
92 $use_pm = getStringFromRequest('use_pm');
93 $use_scm = getStringFromRequest('use_scm');
94 $use_news = getStringFromRequest('use_news');
95 $use_docman = getStringFromRequest('use_docman');
96 $use_ftp = getStringFromRequest('use_ftp');
97 $use_tracker = getStringFromRequest('use_tracker');
98 $use_frs = getStringFromRequest('use_frs');
99 $use_stats = getStringFromRequest('use_stats');
100 $tags = getStringFromRequest('form_tags');
101 $is_public = getIntFromRequest('is_public');
102 $new_doc_address = getStringFromRequest('new_doc_address');
103 $send_all_docs = getStringFromRequest('send_all_docs');
105 $res = $group->update(
132 $feedback .= $group->getErrorMessage();
134 $feedback .= _('Project information updated');
140 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="post">
142 <input type="hidden" name="group_id" value="<?php echo $group->getID(); ?>" />
145 <?php echo _('Descriptive Project Name') ?>:<br />
146 <input type="text" name="form_group_name" value="<?php echo $group->getPublicName(); ?>" size="40" maxlength="40" />
150 <?php echo _('Short Description (255 Character Max, HTML will be stripped from this description)') ?>:<br />
151 <textarea cols="80" rows="3" name="form_shortdesc">
152 <?php echo $group->getDescription(); ?>
157 <?php echo _('Tags (use comma as separator)') ?>:<br />
158 <input type="text" name="form_tags" size="100" value="<?php echo $group->getTags(); ?>" />
161 <p><?php echo _('Trove Categorization: ') ?><a href="/project/admin/group_trove.php?group_id=<?php echo $group->getID(); ?>">[<?php echo _('Edit') ?>]</a></p>
164 <?php echo _('Homepage Link') ?>:<br />
165 <input type="text" name="form_homepage" size="100" value="<?php echo $group->getHomePage(); ?>" />
169 if ($sys_use_private_project) {
171 echo _('Visibility: ');
172 echo html_build_select_box_from_arrays(
174 array( _('Private'), _('Public') ),
175 'is_public', $group->isPublic(), false);
177 echo "<input type=hidden name=\"is_public\" value=\"1\">";
182 // This function is used to render checkboxes below
185 return 'checked="checked"';
195 <input type="hidden" name="use_mail" value="<?php echo ($group->usesMail() ? '1' : '0'); ?>" />
199 if($sys_use_survey) {
201 <input type="hidden" name="use_survey" value="<?php echo ($group->usesSurvey() ? '1' : '0'); ?>" />
207 <input type="hidden" name="use_forum" value="<?php echo ($group->usesForum() ? '1' : '0'); ?>" />
213 <input type="hidden" name="use_pm" value="<?php echo ($group->usesPM() ? '1' : '0'); ?>" />
219 <input type="hidden" name="use_scm" value="<?php echo ($group->usesSCM() ? '1' : '0'); ?>" />
225 <input type="hidden" name="use_news" value="<?php echo ($group->usesNews() ? '1' : '0'); ?>" />
229 if($sys_use_docman) {
231 <input type="hidden" name="use_docman" value="<?php echo ($group->usesDocman() ? '1' : '0'); ?>" />
237 <input type="hidden" name="use_ftp" value="<?php echo ($group->usesFTP() ? '1' : '0'); ?>" />
241 if($sys_use_tracker) {
243 <input type="hidden" name="use_tracker" value="<?php echo ($group->usesTracker() ? '1' : '0'); ?>" />
249 <input type="hidden" name="use_frs" value="<?php echo ($group->usesFRS() ? '1' : '0'); ?>" />
252 <input type="hidden" name="use_stats" value="<?php echo ($group->usesStats() ? '1' : '0'); ?>" />
255 <?php echo _('If you wish, you can provide default email addresses to which new submissions will be sent') ?>.<br />
256 <strong><?php echo _('New Document Submissions') ?>:</strong><br />
257 <input type="text" name="new_doc_address" value="<?php echo $group->getDocEmailAddress(); ?>" size="40" maxlength="250" />
258 <?php echo _('(send on all updates)') ?>
259 <input type="checkbox" name="send_all_docs" value="1" <?php echo c($group->docEmailAll()); ?> />
263 <input type="submit" name="submit" value="<?php echo _('Update') ?>" />
269 plugin_hook('admin_project_link',$group_id) ;
271 echo $HTML->boxBottom();?>
280 project_admin_footer(array());
284 // c-file-style: "bsd"