From: tassium Date: Tue, 21 Feb 2006 17:05:34 +0000 (+0000) Subject: Added "bad plugin" blacklist (currently contains "view_as_html" and "folder_preferenc... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3a196538114904286610d1d74913693fb36f8c0c;p=squirrelmail.git Added "bad plugin" blacklist (currently contains "view_as_html" and "folder_preferences". Plugins known to not work, or known to be already integrated into the core (and thus should not be used as a separate plugin) should be added to this list. Modified do_err to support the concept of fatal errors and warnings. Fatal errors stop the script. Warnings allow the rest of the script to continue. do_err(string error-text, boolean fatal=true) Minor adjustment to php version display, no alteration to actual test. Minor adjustment to end summary (warnings, or setup looks ok text) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10789 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/configtest.php b/src/configtest.php index bcd2d2de..9bddb39a 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -17,14 +17,19 @@ // This script could really use some restructuring as it has grown quite rapidly // but is not very 'clean'. Feel free to get some structure into this thing. +$warnings = 0; -function do_err($str, $exit = TRUE) { +function do_err($str, $fatal = TRUE) { global $IND; - echo '

'.$IND.'ERROR: ' .$str. "

\n"; - if($exit) { + global $warnings; + $level = $fatal ? 'FATAL ERROR:' : 'WARNING:'; + echo '

'.$IND.'' . $level . ' ' .$str. "

\n"; + if($fatal) { echo ''; exit; - } + } else { + $warnings++; + } } $IND = str_repeat(' ',4); @@ -104,7 +109,7 @@ if(!check_php_version(4,1,0)) { do_err('Insufficient PHP version: '. PHP_VERSION . '! Minimum required: 4.1.0'); } -echo $IND . 'PHP version ' . PHP_VERSION . " OK.
\n"; +echo $IND . 'PHP version ' . PHP_VERSION . ' OK. (You have: ' . phpversion() . ". Minimum: 4.1.0)
\n"; $php_exts = array('session','pcre'); $diff = array_diff($php_exts, get_loaded_extensions()); @@ -189,13 +194,17 @@ if($data_dir == $attachment_dir) { /* check plugins and themes */ +$bad_plugins = array('view_as_html','folder_preferences'); + if (isset($plugins[0])) { foreach($plugins as $plugin) { if(!file_exists(SM_PATH .'plugins/'.$plugin)) { do_err('You have enabled the '.$plugin.' plugin but I cannot find it.', FALSE); } elseif (!is_readable(SM_PATH .'plugins/'.$plugin.'/setup.php')) { do_err('You have enabled the '.$plugin.' plugin but I cannot read its setup.php file.', FALSE); - } + } elseif (in_array($plugin, $bad_plugins)) { + do_err('You have enabled the '.$plugin.' plugin, which causes problems with this version of SquirrelMail. Please check the ReleaseNotes or other documentation for more information.', false); + } } echo $IND . "Plugins OK.
\n"; } else { @@ -585,11 +594,21 @@ if( empty($ldap_server) ) { } } -?> - +echo '
'; +echo '

Summary

'; +$footer = '
'; +if ($warnings) { + echo '

No fatal errors were found, but there was at least 1 warning. Please check the flagged issue(s) carefully, as correcting them may prevent erratic, undefined, or incorrect behavior (or flat out breakage).

'; + echo $footer; +} else { +print <<< EOF

Congratulations, your SquirrelMail setup looks fine to me!

Login now

- \ No newline at end of file + +EOF; +echo $footer; +} +?>