5 * This pages lists all global administration facilities for the
6 * site, including user/group properties editing, maintanance of
7 * site meta-information (Trove maps, metadata for file releases),
10 * Copyright 1999-2001 (c) VA Linux Systems
11 * Copyright 2010 (c) FusionForge Team
12 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
13 * Copyright 2011, Franck Villaume - Capgemini
14 * Copyright 2013-2014, Franck Villaume - TrivialDev
15 * Copyright 2017, Stéphane-Eymeric Bredthauer - TrivialDev
16 * http://fusionforge.org
18 * This file is part of FusionForge. FusionForge is free software;
19 * you can redistribute it and/or modify it under the terms of the
20 * GNU General Public License as published by the Free Software
21 * Foundation; either version 2 of the Licence, or (at your option)
24 * FusionForge is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License along
30 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
31 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
34 require_once '../env.inc.php';
35 require_once $gfcommon.'include/pre.php';
36 require_once $gfcommon.'include/FusionForge.class.php';
37 require_once $gfwww.'admin/admin_utils.php';
38 require_once $gfwww.'include/role_utils.php';
40 site_admin_header(array('title'=>_('Site Admin')));
42 $abc_array = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9');
44 echo html_ao('div', array('class' => 'info-box'));
45 echo html_e('h2', array(), _('User Maintenance'));
46 $lielements = array();
47 $forge = FusionForge::getInstance();
48 $lielements[] = array('content' => sprintf(_('Active site users: <strong>%d</strong>'), $forge->getNumberOfActiveUsers()));
49 $lielements[] = array('content' => util_make_link('/admin/userlist.php', _('Display Full User List/Edit Users')));
50 $localcontent = _('Display Users Beginning with')._(': ');
51 $localcontent .= html_ao('div', array('class' => 'abc'));
52 for ($i = 0; $i < count($abc_array); $i++) {
53 $localcontent .= util_make_link('/admin/userlist.php?user_name_search='.$abc_array[$i], $abc_array[$i]);
55 $localcontent .= html_ac(html_ap() -1); // </div> .abc
56 $localcontent .= html_e('br');
57 $localcontent .= $HTML->openForm(array('name' => 'usersrch', 'action' => '/admin/search.php', 'method' => 'post'));
58 $localcontent .= _('Search <em>(userid, username, realname, email)</em>');
59 $localcontent .= html_e('input', array('type' => 'text', 'name' => 'search'));
60 $localcontent .= html_e('input', array('type' => 'hidden', 'name' => 'substr', 'value' => 1));
61 $localcontent .= html_e('input', array('type' => 'hidden', 'name' => 'usersearch', 'value' => 1));
62 $localcontent .= html_e('input', array('type' => 'submit', 'value' => _('Search')));
63 $localcontent .= $HTML->closeForm();
64 $lielements[] = array('content' => $localcontent);
65 $lielements[] = array('content' => util_make_link('/account/register.php', _('Register a New User')));
66 $lielements[] = array('content' => util_make_link('/admin/userlist.php?status=P', _('Pending users')));
67 echo $HTML->html_list($lielements);
69 $params = array('result' => '');
70 $plugins_site_admin_user_html = '';
71 plugin_hook_by_reference("site_admin_user_maintenance_hook", $params);
72 if ($params['result']) {
73 $plugins_site_admin_user_html = $params['result'];
75 if ($plugins_site_admin_user_html) {
76 echo '<h3>'. _('Plugins User Maintenance') .'</h3>';
78 echo $plugins_site_admin_user_html;
81 echo html_ac(html_ap() - 1);
84 <div class="info-box">
85 <h2><?php echo _('Global roles and permissions'); ?></h2>
89 echo $HTML->openForm(array('action' => '/admin/globalroleedit.php', 'method' => 'post'));
90 echo global_role_box('role_id');
91 echo '<input type="submit" name="edit" value="'._("Edit Role").'" />'.$HTML->closeForm();
97 echo $HTML->openForm(array('action' => '/admin/globalroleedit.php', 'method' => 'post'));
98 echo '<input type="text" name="role_name" size="10" value="" required="required" />';
99 echo '<input type="submit" name="add" value="'._("Create Role").'" />'.$HTML->closeForm();
104 <div class="info-box">
105 <h2><?php echo _('Project Maintenance'); ?></h2>
108 $res = db_query_params('SELECT count(*) AS count FROM groups
110 AND register_time > 0
111 AND is_template = 0',
113 $row = db_fetch_array($res);
114 echo _('Registered projects')._(': ').'<strong>'.$row['count'].'</strong>';
117 $res = db_query_params('SELECT count(*) AS count FROM groups
120 AND register_time > 0
121 AND is_template = 0',
123 $row = db_fetch_array($res);
124 echo _('Active projects')._(': ').'<strong>'.$row['count'].'</strong>';
127 $res = db_query_params('SELECT count(*) AS count FROM groups
130 AND register_time > 0
131 AND is_template = 0',
133 $row = db_fetch_array($res);
134 echo _('Pending projects')._(': ').'<strong>'.$row['count'].'</strong>';
136 <li><?php echo util_make_link('/admin/grouplist.php', _('Display Full Project List/Edit Projects')); ?></li>
138 <li><?php echo _('Display Projects Beginning with:').' ';
139 echo html_ao('div', array('class' => 'abc'));
140 for ($i=0; $i < count($abc_array); $i++) {
141 echo util_make_link('/admin/grouplist.php?group_name_search='.$abc_array[$i], $abc_array[$i]);
143 echo html_ac(html_ap() -1); // </div> .abc
145 echo $HTML->openForm(array('name'=> 'gpsrch', 'action' => '/admin/search.php', 'method' => 'post'));
146 echo _('Search <em>(groupid, project Unix name, project full name)</em>'); ?>:
147 <input type="text" name="search" />
148 <input type="hidden" name="substr" value="1" />
149 <input type="hidden" name="groupsearch" value="1" />
150 <input type="submit" value="<?php echo _('Search'); ?>" />
151 <?php echo $HTML->closeForm(); ?>
153 <li><?php echo util_make_link('/register/',_('Register New Project')); ?></li>
154 <li><?php echo util_make_link('/admin/approve-pending.php', _('Pending projects (new project approval)')); ?></li>
155 <li><?php echo $HTML->openForm(array('name' => 'projectsearch', 'action' => '/admin/search.php', 'method' => 'post')); ?>
157 <?php echo _('Projects with status'); ?>
159 <select id="status" name="status">
160 <option value="A"><?php echo _('Active (A)'); ?></option>
161 <option value="H"><?php echo _('Hold (H)'); ?></option>
162 <option value="P"><?php echo _('Pending (P)'); ?></option>
164 <input type="hidden" name="groupsearch" value="1"/>
165 <input type="hidden" name="search" value="%"/>
166 <input type="submit" value="<?php echo _('Submit');?> "/>
167 <?php echo $HTML->closeForm(); ?></li>
168 <li><?php echo util_make_link('/admin/search.php?groupsearch=1&is_public=0', _('Private Projects')); ?></li>
171 $params = array('result' => '');
172 $plugins_site_admin_project_html = '';
173 plugin_hook_by_reference("site_admin_project_maintenance_hook", $params);
174 if ($params['result']) {
175 $plugins_site_admin_project_html = $params['result'];
177 if ($plugins_site_admin_project_html) {
178 echo '<h3>'. _('Plugins Project Maintenance') .'</h3>';
180 echo $plugins_site_admin_project_html;
186 <?php if(forge_get_config('use_news')) {?>
187 <div class="info-box">
188 <?php echo html_e('h2', array(), _('News')); ?>
190 <li><?php echo util_make_link('/admin/pending-news.php', _('Pending news (moderation for front-page)')); ?></li>
195 if(forge_get_config('use_diary')) {?>
196 <div class="info-box">
197 <?php echo html_e('h2', array(), _('Diary & Notes')); ?>
199 <li><?php echo util_make_link('/admin/pending-diary.php', _('Pending diary & notes (moderation for headlines front-page)')); ?></li>
204 <div class="info-box">
205 <?php echo html_e('h2', array(), _('Stats')); ?>
207 <li><?php echo util_make_link('/stats/', _('Site-Wide Stats')); ?></li>
208 <?php plugin_hook('webanalytics_admin', array()); ?>
212 <div class="info-box">
213 <?php echo html_e('h2', array(), _('Trove Project Tree')); ?>
215 <li><?php echo util_make_link('/admin/trove/trove_cat_list.php', _('Display Trove Map')); ?></li>
216 <li><?php echo util_make_link('/admin/trove/trove_cat_add.php', _('Add to the Trove Map')); ?></li>
220 <div class="info-box">
221 <?php echo html_e('h2', array(), _('Site Utilities')); ?>
223 <li><?php echo util_make_link('/admin/massmail.php', sprintf(_('Mail Engine for %s Subscribers'), forge_get_config ('forge_name'))); ?></li>
224 <li><?php echo util_make_link('/admin/unsubscribe.php', forge_get_config('forge_name').' '._('Site Mailings Maintenance')); ?></li>
225 <li><?php echo util_make_link('/admin/effortunitsedit.php', _('Manage Effort Units')); ?></li>
226 <li><?php echo util_make_link('/admin/edit_frs_filetype.php', _('Add, Delete, or Edit File Types')); ?></li>
227 <li><?php echo util_make_link('/admin/edit_frs_processor.php', _('Add, Delete, or Edit Processors')); ?></li>
228 <li><?php echo util_make_link('/admin/edit_theme.php', _('Add, Delete, or Edit Themes')); ?></li>
229 <li><?php echo util_make_link('/stats/lastlogins.php', _('Most Recent Opened Sessions')); ?></li>
230 <li><?php echo util_make_link('/admin/cronman.php', _('Cron Manager')); ?></li>
231 <li><?php echo util_make_link('/admin/pluginman.php', _('Plugin Manager')); ?></li>
232 <li><?php echo util_make_link('/admin/configman.php', _('Config Manager')); ?></li>
233 <?php plugin_hook("site_admin_option_hook", array()); ?>
236 <?php if(forge_get_config('use_project_vhost') || forge_get_config('use_people')) { ?>
238 <?php if(forge_get_config('use_project_vhost')) { ?>
239 <li><?php echo util_make_link('/admin/vhost.php', _('Virtual Host Admin Tool')); ?></li>
241 if(forge_get_config('use_people')) { ?>
242 <li><?php echo util_make_link('/people/admin/', _('Job / Categories Administration')); ?></li>
252 // c-file-style: "bsd"