]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-connect.php
Surfbar now has admin menu (dummy extension!), menu system rebuilded for unique key...
[mailer.git] / inc / mysql-connect.php
index 813bcb6762ee73837ba309bf162b1a78d7ce19eb..20f4233310d567c28386d0cce369264da24c1bf6 100644 (file)
@@ -64,11 +64,6 @@ if ((empty($MySQL['login'])) && (!isBooleanConstantAndTrue('mxchange_installing'
        echo "<STRONG>".LANG_WARNING.":</STRONG> ".WARN_NULL_PASSWORD;
 }
 
-// Init configuration arrays
-$_CONFIG = array(
-       'code_length' => 0
-);
-
 // Check if this file is writeable or read-only and warn the user
 if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed'))) {
        // Check for write-permission for config.php and inc directory
@@ -79,9 +74,6 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
        }
        $EXT_CSS_FILES = array();
 
-       // Load "databases" aka static arrays
-       require_once(PATH."inc/databases.php");     // Several hard-coded databases (arrays, constants)
-
        if ((!empty($MySQL['host'])) && (!empty($MySQL['login'])) && (!empty($MySQL['password'])) && (!empty($MySQL['dbase']))) {
                // Connect to DB
                global $link;
@@ -127,8 +119,8 @@ LIMIT 1", __FILE__, __LINE__);
                                                define('__DAILY_RESET', "1");
                                        }
 
-                                       // Load all extensions
-                                       require_once(PATH."inc/load_extensions.php");
+                                       // Load "databases" aka static arrays
+                                       require_once(PATH."inc/databases.php");
 
                                        // Loading patching system is required here...
                                        require_once(PATH."inc/patch-system.php"); // Initialize patch system
@@ -136,9 +128,6 @@ LIMIT 1", __FILE__, __LINE__);
                                        // Functions which are related to themes
                                        require_once(PATH."inc/theme-manager.php");
 
-                                       // Initialize session management
-                                       require_once(PATH."inc/session.php");
-
                                        // Load admin include file if he is admin
                                        if (IS_ADMIN()) {
                                                // Administrative functions
@@ -163,7 +152,7 @@ LIMIT 1", __FILE__, __LINE__);
                                        UPDATE_ONLINE_LIST(get_session('PHPSESSID'), $GLOBALS['module'], $GLOBALS['action'], $GLOBALS['what']);
 
                                        // Load theme name
-                                       $CurrTheme = GET_CURR_THEME();
+                                       $currTheme = GET_CURR_THEME();
 
                                        // Set default 'what' value
                                        //* DEBUG */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />\n";
@@ -205,6 +194,13 @@ LIMIT 1", __FILE__, __LINE__);
 
                                // Free memory
                                SQL_FREERESULT($result);
+
+                               // 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 {
                                // Wrong database?
                                ADD_FATAL(WRONG_DB_SELECTED);
@@ -234,8 +230,6 @@ LIMIT 1", __FILE__, __LINE__);
        // Include required files
        require_once(PATH."inc/databases.php");
        require_once(PATH."inc/theme-manager.php");
-       require_once(PATH."inc/load_extensions.php");
-       require_once(PATH."inc/session.php");
 
        // Check if we are in installation routine
        $installPhp = basename($_SERVER['PHP_SELF']);