* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-function site_admin_header($params, $required_perm = 'forge_admin') {
- session_require_global_perm ($required_perm);
+function check_system() {
+ $result = array();
if (version_compare(PHP_VERSION, '5.1.0', '<')) {
- $GLOBALS['warning_msg'] = 'WARNING: Your php version must not be lower than 5.1.0, please upgrade';
+ $result[] = 'WARNING: Your php version must not be lower than 5.1.0, please upgrade';
}
if (get_magic_quotes_gpc()) {
- $GLOBALS['warning_msg'] = 'WARNING: Your installation is running with php magic_quotes_gpc ON, please change to OFF';
+ $result[] = 'ERROR: Your installation is running with PHP magic_quotes_gpc ON, please change to OFF';
}
if (ini_get('register_globals')) {
- $GLOBALS['warning_msg'] = 'WARNING: Your installation is running with php register_globals ON, this is very unsecure, please change to OFF';
+ $result[] = 'ERROR: Your installation is running with PHP register_globals ON, this is very unsecure, please change to OFF';
+ }
+ if (util_ini_get_bytes('post_max_size') < 8*1024*1024) {
+ $result[] = 'WARNING: PHP value "post_max_size" is low, recommended is at least 8M';
+ }
+ if (util_ini_get_bytes('upload_max_filesize') < 8*1024*1024) {
+ $result[] = 'WARNING: PHP value "upload_max_filesize" is low, recommended is at least 8M';
+ }
+ if (!function_exists("pg_pconnect")) {
+ $result[] = 'ERROR: Missing Postgresql support in PHP, please install/compile php-pg.';
+ }
+ return $result;
+}
+
+function site_admin_header($params, $required_perm = 'forge_admin') {
+ session_require_global_perm ($required_perm);
+
+ if ($msg = check_system()) {
+ $GLOBALS['warning_msg'] = join('<br/> ', $msg);
}
site_header($params);
}