From: Bharat M. <bh...@us...> - 2002-04-12 06:06:28
|
Update of /cvsroot/gallery/gallery/setup In directory usw-pr-cvs1:/tmp/cvs-serv20303 Modified Files: config_data.inc functions.inc Log Message: Detect safe mode on the system check page and do not let the user proceed if it is enabled. Index: config_data.inc =================================================================== RCS file: /cvsroot/gallery/gallery/setup/config_data.inc,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- config_data.inc 23 Mar 2002 23:46:02 -0000 1.69 +++ config_data.inc 12 Apr 2002 06:06:23 -0000 1.70 @@ -28,6 +28,19 @@ "fail-incompatible" => "You're running version " . phpversion() . " which has known bugs that cause Gallery to fail.", ), + "safe_mode" => array( + "desc" => "Check to see if PHP is running in <b>Safe Mode</b>. Safe mode is a ". + "PHP security feature commonly used in shared environments. Gallery ". + "cannot run when safe mode is enabled because it imposes too many ". + "restrictions.", + "func" => "check_safe_mode", + "fail-safe-mode" => "<b>Safe Mode</b> is enabled on this server. You must ". + "disable it before you can use Gallery. Refer to the FAQ and the ". + "mailing lists on the <a href='http://gallery.sourceforge.net'>". + "Gallery website</a>, and the ". + "<a href='http://www.php.net/manual/en/features.safe-mode.php'>". + "PHP website</a> for assistance.", + ), "htaccess" => array( "desc" => "Allow the Gallery <b>.htaccess</b> file to set " . "application specific configuration options " . Index: functions.inc =================================================================== RCS file: /cvsroot/gallery/gallery/setup/functions.inc,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- functions.inc 23 Mar 2002 23:46:02 -0000 1.36 +++ functions.inc 12 Apr 2002 06:06:23 -0000 1.37 @@ -268,6 +268,18 @@ return array($success, $fail); } +function check_safe_mode() +{ + $fail = array(); + $success = array(); + if (get_cfg_var("safe_mode")) { + $fail["fail-safe-mode"]++; + } else { + $success[] = "safe mode is off"; + } + return array($success, $fail); +} + function check_magic_quotes() { $fail = array(); |