+if ( (!ini_get('safe_mode')) || function_exists('date_default_timezone_set') ||
+ !strcmp(ini_get('safe_mode_allowed_env_vars'),'') ||
+ preg_match('/^([\w_]+,)*TZ/', ini_get('safe_mode_allowed_env_vars')) ) {
+ echo "Webmail users can change their time zone settings. \n";
+} else {
+ echo "Webmail users can't change their time zone settings. \n";
+}
+if (isset($_ENV['TZ'])) {
+ echo 'Default time zone is '.htmlspecialchars($_ENV['TZ']);
+} else {
+ echo 'Current time zone is '.date('T');
+}
+echo ".<br />\n";
+
+// Pear DB tests
+echo "Checking database functions...<br />\n";
+if($addrbook_dsn || $prefs_dsn || $addrbook_global_dsn) {
+ @include_once('DB.php');
+ if (class_exists('DB')) {
+ echo "$IND PHP Pear DB support is present.<br />\n";
+ $db_functions=array(
+ 'dbase' => 'dbase_open',
+ 'fbsql' => 'fbsql_connect',
+ 'interbase' => 'ibase_connect',
+ 'informix' => 'ifx_connect',
+ 'msql' => 'msql_connect',
+ 'mssql' => 'mssql_connect',
+ 'mysql' => 'mysql_connect',
+ 'mysqli' => 'mysqli_connect',
+ 'oci8' => 'ocilogon',
+ 'odbc' => 'odbc_connect',
+ 'pgsql' => 'pg_connect',
+ 'sqlite' => 'sqlite_open',
+ 'sybase' => 'sybase_connect'
+ );
+
+ $dsns = array();
+ if($prefs_dsn) {
+ $dsns['preferences'] = $prefs_dsn;
+ }
+ if($addrbook_dsn) {
+ $dsns['addressbook'] = $addrbook_dsn;
+ }
+ if($addrbook_global_dsn) {
+ $dsns['global addressbook'] = $addrbook_global_dsn;
+ }
+
+ foreach($dsns as $type => $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";
+
+ // now, test this interface:
+
+ $dbh = DB::connect($dsn, true);
+ if (DB::isError($dbh)) {
+ do_err('Database error: '. htmlspecialchars(DB::errorMessage($dbh)) .
+ ' in ' .$type .' DSN.');
+ }
+ $dbh->disconnect();
+ echo "$IND$type database connect successful.<br />\n";
+
+ } else {
+ do_err($dbtype.' database support not present!');
+ }
+ }
+ } else {
+ $db_error='Required PHP PEAR DB support is not available.'
+ .' Is PEAR installed and is the include path set correctly to find <tt>DB.php</tt>?'
+ .' The include path is now:<tt>' . ini_get('include_path') . '</tt>.';
+ do_err($db_error);
+ }