|
From: <pdo...@us...> - 2009-05-05 23:09:33
|
Revision: 13653
http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=13653&view=rev
Author: pdontthink
Date: 2009-05-05 23:09:28 +0000 (Tue, 05 May 2009)
Log Message:
-----------
session.auto_start is not compatible with 1.4.x in my tests; put a warning in configtest... trying to actually fix the problem by backporting 1.5.x code is complicated and may disrupt the stable codebase
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
Modified: branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2009-05-03 13:03:52 UTC (rev 13652)
+++ branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2009-05-05 23:09:28 UTC (rev 13653)
@@ -92,6 +92,16 @@
echo $IND . 'error_reporting: ' . ini_get('error_reporting') . "<br />\n";
+// FIXME: words like "probably" and "usually" should be removed and do_err() should be called with TRUE for the second argument when we confirm that this does in fact affect everyone
+if ((bool) ini_get('session.auto_start') && ini_get('session.auto_start') != 'off') {
+ $msg = 'session.auto_start is turned on in your PHP configuration, but SquirrelMail'
+ . ' 1.4.x probably will not work with it (otherwise valid logins will usually'
+ . ' result in "You must be logged in to access this page" errors).'
+ . ' You can disable session.auto_start only in the squirrelmail directory'
+ . ' if you need to leave it turned on for other applications.';
+ do_err($msg, false);
+}
+
$safe_mode = ini_get('safe_mode');
if ($safe_mode) {
echo $IND . 'safe_mode: ' . $safe_mode;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pdo...@us...> - 2009-07-02 16:39:48
|
Revision: 13787
http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=13787&view=rev
Author: pdontthink
Date: 2009-07-02 16:39:47 +0000 (Thu, 02 Jul 2009)
Log Message:
-----------
Make session.auto_start = 1 a fatal condition
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
Modified: branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2009-06-07 10:17:59 UTC (rev 13786)
+++ branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2009-07-02 16:39:47 UTC (rev 13787)
@@ -92,14 +92,13 @@
echo $IND . 'error_reporting: ' . ini_get('error_reporting') . "<br />\n";
-// FIXME: words like "probably" and "usually" should be removed and do_err() should be called with TRUE for the second argument when we confirm that this does in fact affect everyone
if ((bool) ini_get('session.auto_start') && ini_get('session.auto_start') != 'off') {
$msg = 'session.auto_start is turned on in your PHP configuration, but SquirrelMail'
- . ' 1.4.x probably will not work with it (otherwise valid logins will usually'
+ . ' 1.4.x will not work with it (otherwise valid logins will usually'
. ' result in "You must be logged in to access this page" errors).'
. ' You can disable session.auto_start only in the squirrelmail directory'
. ' if you need to leave it turned on for other applications.';
- do_err($msg, false);
+ do_err($msg, true);
}
$safe_mode = ini_get('safe_mode');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pdo...@us...> - 2010-04-16 05:24:50
|
Revision: 13933
http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=13933&view=rev
Author: pdontthink
Date: 2010-04-16 05:24:43 +0000 (Fri, 16 Apr 2010)
Log Message:
-----------
Show what user/group the web server is running as; helps with debugging certain plugins for admins who aren't quite sure about these things
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
Modified: branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2010-03-30 05:54:31 UTC (rev 13932)
+++ branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2010-04-16 05:24:43 UTC (rev 13933)
@@ -88,6 +88,32 @@
echo $IND . 'PHP version ' . PHP_VERSION . " OK.<br />\n";
+// try to determine information about the user and group the web server is running as
+//
+$webOwnerID = 'N/A';
+$webOwnerInfo = array('name' => 'N/A');
+if (function_exists('posix_getuid'))
+ $webOwnerID = posix_getuid();
+if ($webOwnerID === FALSE)
+ $webOwnerID = 'N/A';
+if ($webOwnerID !== 'N/A' && function_exists('posix_getpwuid'))
+ $webOwnerInfo = posix_getpwuid($webOwnerID);
+if (!$webOwnerInfo)
+ $webOwnerInfo = array('name' => 'N/A');
+$webGroupID = 'N/A';
+$webGroupInfo = array('name' => 'N/A');
+if (function_exists('posix_getgid'))
+ $webGroupID = posix_getgid();
+if ($webGroupID === FALSE)
+ $webGroupID = 'N/A';
+if ($webGroupID !== 'N/A' && function_exists('posix_getgrgid'))
+ $webGroupInfo = posix_getgrgid($webGroupID);
+if (!$webGroupInfo)
+ $webGroupInfo = array('name' => 'N/A');
+
+echo $IND . 'Running as ' . $webOwnerInfo['name'] . '(' . $webOwnerID
+ . ') / ' . $webGroupInfo['name'] . '(' . $webGroupID . ")<br />\n";
+
echo $IND . 'display_errors: ' . ini_get('display_errors') . "<br />\n";
echo $IND . 'error_reporting: ' . ini_get('error_reporting') . "<br />\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pdo...@us...> - 2015-06-14 10:19:16
|
Revision: 14503
http://sourceforge.net/p/squirrelmail/code/14503
Author: pdontthink
Date: 2015-06-14 10:19:14 +0000 (Sun, 14 Jun 2015)
Log Message:
-----------
Sync configtest with core
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
Modified: branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2015-06-14 10:15:51 UTC (rev 14502)
+++ branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2015-06-14 10:19:14 UTC (rev 14503)
@@ -1,4 +1,5 @@
<?php
+echo "Disallowed"; die;
/**
* SquirrelMail configtest script
@@ -382,7 +383,10 @@
echo $IND . "sendmail OK<br />\n";
} else {
- $stream = fsockopen( ($use_smtp_tls?'tls://':'').$smtpServerAddress, $smtpPort,
+ // NB: Using "ssl://" ensures the highest possible TLS version
+ // will be negotiated with the server (whereas "tls://" only
+ // uses TLS version 1.0)
+ $stream = fsockopen( ($use_smtp_tls?'ssl://':'').$smtpServerAddress, $smtpPort,
$errorNumber, $errorString);
if(!$stream) {
do_err("Error connecting to SMTP server \"$smtpServerAddress:$smtpPort\".".
@@ -427,7 +431,10 @@
echo "Checking IMAP service....<br />\n";
/** Can we open a connection? */
-$stream = fsockopen( ($use_imap_tls?'tls://':'').$imapServerAddress, $imapPort,
+// NB: Using "ssl://" ensures the highest possible TLS version
+// will be negotiated with the server (whereas "tls://" only
+// uses TLS version 1.0)
+$stream = fsockopen( ($use_imap_tls?'ssl://':'').$imapServerAddress, $imapPort,
$errorNumber, $errorString);
if(!$stream) {
do_err("Error connecting to IMAP server \"$imapServerAddress:$imapPort\".".
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pdo...@us...> - 2016-01-09 19:01:00
|
Revision: 14546
http://sourceforge.net/p/squirrelmail/code/14546
Author: pdontthink
Date: 2016-01-09 19:00:58 +0000 (Sat, 09 Jan 2016)
Log Message:
-----------
Update checks to reflect recent changes
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
Modified: branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2016-01-01 21:30:56 UTC (rev 14545)
+++ branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2016-01-09 19:00:58 UTC (rev 14546)
@@ -359,9 +359,10 @@
"</tt> (location base " . (empty($config_location_base) ? 'autodetected' : 'set to <tt>' .
sm_encode_html_special_chars($config_location_base)."</tt>") . ")<br />\n";
-/* check outgoing mail */
+/* check minimal requirements for other security options */
-if($use_smtp_tls || $use_imap_tls) {
+/* imaps or ssmtp */
+if($use_smtp_tls == 1 || $use_imap_tls == 1) {
if(!check_php_version(4,3,0)) {
do_err('You need at least PHP 4.3.0 for SMTP/IMAP TLS!');
}
@@ -369,7 +370,21 @@
do_err('You need the openssl PHP extension to use SMTP/IMAP TLS!');
}
}
+/* starttls extensions */
+if($use_smtp_tls === 2 || $use_imap_tls === 2) {
+ if (! function_exists('stream_socket_enable_crypto')) {
+ do_err('If you want to use STARTTLS extension, you need stream_socket_enable_crypto() function from PHP 5.1.0 and newer.');
+ }
+}
+/* digest-md5 */
+if ($smtp_auth_mech=='digest-md5' || $imap_auth_mech =='digest-md5') {
+ if (!extension_loaded('xml')) {
+ do_err('You need the PHP XML extension to use Digest-MD5 authentication!');
+ }
+}
+/* check outgoing mail */
+
echo "Checking outgoing mail service....<br />\n";
if($useSendmail) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pdo...@us...> - 2016-10-29 18:57:41
|
Revision: 14590
http://sourceforge.net/p/squirrelmail/code/14590
Author: pdontthink
Date: 2016-10-29 18:57:39 +0000 (Sat, 29 Oct 2016)
Log Message:
-----------
Use PDO for database access if available (adds PHP 7 compatibility)
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
Modified: branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2016-10-29 18:39:24 UTC (rev 14589)
+++ branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2016-10-29 18:57:39 UTC (rev 14590)
@@ -550,70 +550,113 @@
echo "Webmail users can't change their time zone settings.<br />\n";
}
-// Pear DB tests
+// Database tests
echo "Checking database functions...<br />\n";
if(!empty($addrbook_dsn) || !empty($prefs_dsn) || !empty($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;
+ }
- $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;
- }
+ global $disable_pdo, $use_pdo;
+ if (empty($disable_pdo) && class_exists('PDO'))
+ $use_pdo = TRUE;
+ else
+ $use_pdo = FALSE;
+ if ($use_pdo) {
+
+ // test connecting to each 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";
- } elseif(!(bool)ini_get('enable_dl') || (bool)ini_get('safe_mode')) {
- do_err($dbtype.' database support not present!');
- } else {
- // Non-fatal error
- do_err($dbtype.' database support not present or not configured!
- Trying to dynamically load '.$dbtype.' extension.
- Please note that it is advisable to not rely on dynamic loading of extensions.', FALSE);
+ // parse and convert DSN to PDO style
+ // $matches will contain:
+ // 1: database type
+ // 2: username
+ // 3: password
+ // 4: hostname
+ // 5: database name
+//TODO: add support for unix_socket and charset
+ if (!preg_match('|^(.+)://(.+):(.+)@(.+)/(.+)$|i', $dsn, $matches)) {
+ return $this->set_error(_("Could not parse prefs DSN"));
+ do_err('DSN parse error in ' .$type .' DSN.');
}
+ if (preg_match('|^(.+):(\d+)$|', $matches[4], $host_port_matches)) {
+ $matches[4] = $host_port_matches[1];
+ $matches[6] = $host_port_matches[2];
+ } else
+ $matches[6] = NULL;
+ $pdo_prefs_dsn = $matches[1] . ':host=' . $matches[4] . (!empty($matches[6]) ? ';port=' . $matches[6] : '') . ';dbname=' . $matches[5];
+ try {
+ $dbh = new PDO($pdo_prefs_dsn, $matches[2], $matches[3]);
+ } catch (Exception $e) {
+ do_err('Database error: '. sm_encode_html_special_chars($e->getMessage()) .
+ ' in ' .$type .' DSN.');
+ }
+ echo "$IND$type database connect successful.<br />\n";
+ }
+ } else {
+ @include_once('DB.php');
+ if (class_exists('DB')) {
+ echo "$IND PHP Pear DB support is present, however it is deprecated and PHP PDO is recommended.<br />\n"
+ .(!empty($disable_pdo) ? "$IND You have set \$disable_pdo - if you experience errors below, try removing that.<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'
+ );
- // now, test this interface:
+ foreach($dsns as $type => $dsn) {
+ $aDsn = explode(':', $dsn);
+ $dbtype = array_shift($aDsn);
- $dbh = DB::connect($dsn, true);
- if (DB::isError($dbh)) {
- do_err('Database error: '. sm_encode_html_special_chars(DB::errorMessage($dbh)) .
- ' in ' .$type .' DSN.');
+ if(isset($db_functions[$dbtype]) && function_exists($db_functions[$dbtype])) {
+ echo "$IND$dbtype database support present.<br />\n";
+ } elseif(!(bool)ini_get('enable_dl') || (bool)ini_get('safe_mode')) {
+ do_err($dbtype.' database support not present!');
+ } else {
+ // Non-fatal error
+ do_err($dbtype.' database support not present or not configured!
+ Trying to dynamically load '.$dbtype.' extension.
+ Please note that it is advisable to not rely on dynamic loading of extensions.', FALSE);
+ }
+
+
+ // now, test this interface:
+
+ $dbh = DB::connect($dsn, true);
+ if (DB::isError($dbh)) {
+ do_err('Database error: '. sm_encode_html_special_chars(DB::errorMessage($dbh)) .
+ ' in ' .$type .' DSN.');
+ }
+ $dbh->disconnect();
+ echo "$IND$type database connect successful.<br />\n";
}
- $dbh->disconnect();
- echo "$IND$type database connect successful.<br />\n";
+ } else {
+ $db_error='Required PHP PDO or PEAR DB support is not available.'
+ .(!empty($disable_pdo) ? ' You have set $disable_pdo - please try removing that.' : '')
+ .' PDO should come preinstalled with PHP version 5.1 or higher.'
+ .' Otherwise, 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);
}
- } 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);
}
} else {
echo $IND."not using database functionality.<br />\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pdo...@us...> - 2019-05-13 18:48:42
|
Revision: 14820
http://sourceforge.net/p/squirrelmail/code/14820
Author: pdontthink
Date: 2019-05-13 18:48:41 +0000 (Mon, 13 May 2019)
Log Message:
-----------
Allow some plugins to run "normal" code that happens to switch text domain
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
Modified: branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2019-04-30 02:33:05 UTC (rev 14819)
+++ branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2019-05-13 18:48:41 UTC (rev 14820)
@@ -300,6 +300,7 @@
}
}
// load plugin functions
+ include_once(SM_PATH . 'functions/i18n.php'); // so some plugins can run "normal" code that switches text domain
include_once(SM_PATH . 'functions/plugin.php');
// turn on output buffering in order to prevent output of new lines
ob_start();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pdo...@us...> - 2021-12-07 19:24:45
|
Revision: 14934
http://sourceforge.net/p/squirrelmail/code/14934
Author: pdontthink
Date: 2021-12-07 19:24:43 +0000 (Tue, 07 Dec 2021)
Log Message:
-----------
Mild improvement in plugin detection
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
Modified: branches/SM-1_4-STABLE/squirrelmail/src/configtest.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2021-11-21 09:24:22 UTC (rev 14933)
+++ branches/SM-1_4-STABLE/squirrelmail/src/configtest.php 2021-12-07 19:24:43 UTC (rev 14934)
@@ -291,7 +291,7 @@
/* check plugins and themes */
-if (isset($plugins[0])) {
+if (!empty($plugins) && is_array($plugins)) {
foreach($plugins as $plugin) {
if(!file_exists(SM_PATH .'plugins/'.$plugin)) {
do_err('You have enabled the <i>'.$plugin.'</i> plugin, but I cannot find it.', FALSE);
@@ -326,7 +326,7 @@
echo $IND . "Plugins OK.<br />\n";
}
} else {
- echo $IND . "Plugins are not enabled in config.<br />\n";
+ echo $IND . "Plugins are not correctly enabled in the configuration file.<br />\n";
}
foreach($theme as $thm) {
if(!file_exists($thm['PATH'])) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|