From: Roland Häder Date: Tue, 23 Sep 2008 17:27:52 +0000 (+0000) Subject: Fix for installation phase (thx to AndreasJung) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bd1c7ebbcafe3833b12f782e26b2f7c4460c11f4;p=mailer.git Fix for installation phase (thx to AndreasJung) --- diff --git a/inc/databases.php b/inc/databases.php index 629140b684..f674ba049e 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "386"); +define('CURR_SVN_REVISION', "387"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index f7df593665..ccbc5ac41e 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -180,11 +180,17 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT // Shall we activate the exchange? if ($_CONFIG['activate_xchange'] > 0) activateExchange(); - // Generate random number - if (isset($GLOBALS['userid'])) { - define('RAND_NUMBER', GEN_RANDOM_CODE(10, mt_rand(10000,32766), $GLOBALS['userid'], "")); + // Is the extension sql_patches installed and at least 0.3.6? + if (GET_EXT_VERSION("sql_patches") >= "0.3.6") { + // Generate random number + if (isset($GLOBALS['userid'])) { + define('RAND_NUMBER', GEN_RANDOM_CODE(10, mt_rand(10000,32766), $GLOBALS['userid'], "")); + } else { + define('RAND_NUMBER', GEN_RANDOM_CODE(10, mt_rand(10000,32766), 0, "")); + } } else { - define('RAND_NUMBER', GEN_RANDOM_CODE(10, mt_rand(10000,32766), 0, "")); + // Generate weak (!!!) code + define('RAND_NUMBER', mt_rand(1000000, 9999999)); } } else { // Wrong database?