From ccbde363363cd5cec208a5b71f2104419b44c7f5 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Mon, 1 Oct 2007 07:59:45 +0000 Subject: [PATCH] Add safe_mode notes in configtest; it might be nice to expand these to do more automated checks (for example, that the webserver has access to the data dir or attachment dir, or that DB.php is accessible, although that is done elsewhere herein) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12716 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/configtest.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/configtest.php b/src/configtest.php index a98595ae..10d7df2a 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -200,6 +200,18 @@ echo $IND . 'display_errors: ' . ini_get('display_errors') . "
\n"; echo $IND . 'error_reporting: ' . ini_get('error_reporting') . "
\n"; +$safe_mode = ini_get('safe_mode'); +if ($safe_mode) { + echo $IND . 'safe_mode: ' . $safe_mode; + if (empty($prefs_dsn) || empty($addrbook_dsn)) + echo ' (double check data and attachment directory ownership, etc!)'; + if (!empty($addrbook_dsn) || !empty($prefs_dsn) || !empty($addrbook_global_dsn)) + echo ' (does PHP have access to database interface?)'; + echo "
\n"; + $safe_mode_exec_dir = ini_get('safe_mode_exec_dir'); + echo $IND . 'safe_mode_exec_dir: ' . $safe_mode_exec_dir . "
\n"; +} + /* register_globals check: test for boolean false and any string that is not equal to 'off' */ if ((bool) ini_get('register_globals') && @@ -302,7 +314,7 @@ echo "Checking paths...
\n"; if(!file_exists($data_dir)) { // data_dir is not that important in db_setups. - if (isset($prefs_dsn) && ! empty($prefs_dsn)) { + if (!empty($prefs_dsn)) { $data_dir_error = "Data dir ($data_dir) does not exist!\n"; echo $IND .'ERROR: ' . $data_dir_error; } else { @@ -311,7 +323,7 @@ if(!file_exists($data_dir)) { } // don't check if errors if(!isset($data_dir_error) && !is_dir($data_dir)) { - if (isset($prefs_dsn) && ! empty($prefs_dsn)) { + if (!empty($prefs_dsn)) { $data_dir_error = "Data dir ($data_dir) is not a directory!\n"; echo $IND . 'ERROR: ' . $data_dir_error; } else { @@ -320,7 +332,7 @@ if(!isset($data_dir_error) && !is_dir($data_dir)) { } // datadir should be executable - but no clean way to test on that if(!isset($data_dir_error) && !is_writable($data_dir)) { - if (isset($prefs_dsn) && ! empty($prefs_dsn)) { + if (!empty($prefs_dsn)) { $data_dir_error = "Data dir ($data_dir) is not writable!\n"; echo $IND . 'ERROR: ' . $data_dir_error; } else { -- 2.25.1