Fix for installation phase (thx to AndreasJung)
authorRoland Häder <roland@mxchange.org>
Tue, 23 Sep 2008 17:27:52 +0000 (17:27 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 23 Sep 2008 17:27:52 +0000 (17:27 +0000)
inc/databases.php
inc/mysql-connect.php

index 629140b6842852b52670c1db9c85cb02ca2322a6..f674ba049e97e688d30afb9d88b6ad181fc370e8 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
 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);
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index f7df593665497ee16ef9bcc6165b1f1240f45c26..ccbc5ac41e17031e8746011d39d330fb0d953b75 100644 (file)
@@ -180,11 +180,17 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                                // Shall we activate the exchange?
                                if ($_CONFIG['activate_xchange'] > 0) activateExchange();
 
                                // 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 {
                                } 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?
                                }
                        } else {
                                // Wrong database?