3 * Module of support routines for Site Admin
5 * Copyright 1999-2001 (c) VA Linux Systems
7 * This file is part of FusionForge. FusionForge is free software;
8 * you can redistribute it and/or modify it under the terms of the
9 * GNU General Public License as published by the Free Software
10 * Foundation; either version 2 of the Licence, or (at your option)
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 function check_system() {
25 if (ini_get('register_globals')) {
26 $result[] = 'Error: Your installation is running with PHP register_globals ON, this is very unsecure, please change to OFF';
28 if (util_ini_get_bytes('post_max_size') < 8*1024*1024) {
29 $result[] = 'WARNING: PHP value "post_max_size" is low, recommended is at least 8M';
31 if (util_ini_get_bytes('upload_max_filesize') < 8*1024*1024) {
32 $result[] = 'WARNING: PHP value "upload_max_filesize" is low, recommended is at least 8M';
34 if (forge_get_config('use_shell')) {
35 // verify the compatibility between the user_default_shell ini var and the contents of .../etc/shells
36 $user_default_shell = forge_get_config('user_default_shell');
37 // pass FALSE to make sure the var contents isn't added to the list
38 $shells = account_getavailableshells(FALSE);
39 if (!in_array($user_default_shell, $shells)) {
40 $result[] = 'WARNING: default user shell "'. $user_default_shell .'" not in allowed shells (check ini var "user_default_shell" and contents of '. forge_get_config('chroot') .'/etc/shells or /etc/shells).';
46 function site_admin_header($params, $required_perm = 'forge_admin') {
47 session_require_global_perm ($required_perm);
49 if ($msg = check_system()) {
50 $GLOBALS['warning_msg'] = join('<br/> ', $msg);
55 function site_admin_footer($params = array()) {
61 // c-file-style: "bsd"