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() {
26 if (version_compare(PHP_VERSION, '5.1.0', '<')) {
27 $result[] = 'WARNING: Your php version must not be lower than 5.1.0, please upgrade';
29 if (get_magic_quotes_gpc()) {
30 $result[] = 'ERROR: Your installation is running with PHP magic_quotes_gpc ON, please change to OFF';
32 if (ini_get('register_globals')) {
33 $result[] = 'ERROR: Your installation is running with PHP register_globals ON, this is very unsecure, please change to OFF';
35 if (util_ini_get_bytes('post_max_size') < 8*1024*1024) {
36 $result[] = 'WARNING: PHP value "post_max_size" is low, recommended is at least 8M';
38 if (util_ini_get_bytes('upload_max_filesize') < 8*1024*1024) {
39 $result[] = 'WARNING: PHP value "upload_max_filesize" is low, recommended is at least 8M';
41 if (!function_exists("pg_pconnect")) {
42 $result[] = 'ERROR: Missing Postgresql support in PHP, please install/compile php-pg.';
47 function site_admin_header($params, $required_perm = 'forge_admin') {
48 session_require_global_perm ($required_perm);
50 if ($msg = check_system()) {
51 $GLOBALS['warning_msg'] = join('<br/> ', $msg);
56 function site_admin_footer($params) {
62 // c-file-style: "bsd"