/**
* SquirrelMail configtest script
*
- * Copyright (c) 2003-2005 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
+ * @copyright © 2003-2005 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
* @subpackage config
if (! $allow_remote_configtest) {
sqGetGlobalVar('REMOTE_ADDR',$client_ip,SQ_SERVER);
if (! isset($client_ip) || $client_ip!='127.0.0.1') {
- do_err('Enable "Allow remote configtest" option in squirrelmail configuration in order to use this script.');
+ do_err('Enable "Allow remote configtest" option in squirrelmail configuration in order to use this script.');
}
}
/* checking PHP specs */
do_err($mb_error);
}
+/**
+ * We code with register_globals = off. SquirrelMail should work in such setup
+ * since 1.2.9 and 1.3.0. Running SquirrelMail with register_globals = on can
+ * cause variable corruption and security issues. Globals can be turned off in
+ * php.ini, webserver config and .htaccess files. Scripts can turn off globals only
+ * in php 4.2.3 or older.
+ */
+if ((bool) ini_get('register_globals')) {
+ $rg_error='You have enabled php register_globals.'
+ .' Running PHP installation with register_globals=on can cause problems.'
+ .' See <a href="http://www.php.net/manual/en/security.registerglobals.php">'
+ .'security information about register_globals</a>.';
+ do_err($rg_error);
+}
+
/* checking paths */
echo "Checking paths...<br />\n";
if ( $squirrelmail_default_language != 'en_US' ) {
$loc_path = SM_PATH .'locale/'.$squirrelmail_default_language.'/LC_MESSAGES/squirrelmail.mo';
if( ! file_exists( $loc_path ) ) {
- do_err('You have set <i>' . $squirrelmail_default_language .
+ do_err('You have set <i>' . $squirrelmail_default_language .
'</i> as your default language, but I cannot find this translation (should be '.
'in <tt>' . $loc_path . '</tt>). Please note that you have to download translations '.
'separately from the main SquirrelMail package.', FALSE);
} elseif ( ! is_readable( $loc_path ) ) {
- do_err('You have set <i>' . $squirrelmail_default_language .
+ do_err('You have set <i>' . $squirrelmail_default_language .
'</i> as your default language, but I cannot read this translation (file '.
'in <tt>' . $loc_path . '</tt> unreadable).', FALSE);
} else {
echo "$IND recode - ";
if (function_exists('recode')) {
echo "Recode functions are available.<br />\n";
-} elseif ($use_php_recode) {
+} elseif (isset($use_php_recode) && $use_php_recode) {
echo "Recode functions are unavailable.<br />\n";
do_err('Your configuration requires recode support, but recode support is missing.');
} else {
echo "$IND iconv - ";
if (function_exists('iconv')) {
echo "Iconv functions are available.<br />\n";
-} elseif ($use_php_iconv) {
+} elseif (isset($use_php_iconv) && $use_php_iconv) {
echo "Iconv functions are unavailable.<br />\n";
do_err('Your configuration requires iconv support, but iconv support is missing.');
} else {
}
foreach($dsns as $type => $dsn) {
- $dbtype = array_shift(explode(':', $dsn));
+ $aDsn = explode(':', $dsn);
+ $dbtype = array_shift($aDsn);
if(isset($db_functions[$dbtype]) && function_exists($db_functions[$dbtype])) {
echo "$IND$dbtype database support present.<br />\n";
echo "$IND$type database connect successful.<br />\n";
} else {
- do_err($db.' database support not present!');
+ do_err($dbtype.' database support not present!');
}
}
} else {
}
}
}
+
?>
<p>Congratulations, your SquirrelMail setup looks fine to me!</p>
<p><a href="login.php">Login now</a></p>
</body>
-</html>
-<?php
-// vim: et ts=4
-?>
+</html>
\ No newline at end of file