]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-connect.php
'userid' rewritten to functions
[mailer.git] / inc / mysql-connect.php
index 87395a3e08d5f7aaf6fe013c6b46acdbb1fb35f4..3ad0efec6165f539c9cd20419c79d397a43b54ae 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Verbindet zu Ihrer Datenbank                     *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision:: 856                                                    $ *
+ * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009)              $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author:: stelzi                                                   $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
@@ -37,14 +42,11 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
-// CFG: DEBUG-SQL (if enabled and DEBUG_MODE is enabled all SQL queries will be logged to debug.log)
-define('DEBUG_SQL', false);
-
 // Non-database functions
 require("inc/functions.php");
 
 // Load more function libraries or includes
-foreach (array('request-functions', 'session-functions', 'config-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks', 'session') as $lib) {
+foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks') as $lib) {
        // Load special functions
        LOAD_INC_ONCE(sprintf("inc/%s.php", $lib));
 } // END - foreach
@@ -52,11 +54,8 @@ foreach (array('request-functions', 'session-functions', 'config-functions', 'fi
 // Set error handler
 set_error_handler('__errorHandler');
 
-// Register shutdown hook
-register_shutdown_function('__SHUTDOWN_HOOK');
-
 // Check if the user setups his MySQL stuff...
-if ((empty($MySQL['login'])) && (!defined('mxchange_installing')) && (!REQUEST_ISSET_GET(('installing'))) && (isInstalled())) {
+if ((empty($MySQL['login'])) && (!isInstalling()) && (!REQUEST_ISSET_GET('installing')) && (isInstalled())) {
        // No login entered and outside installation mode
        OUTPUT_HTML("<strong>{--LANG_WARNING--}:</strong> ");
        if (isInstalled()) {
@@ -71,12 +70,8 @@ if ((empty($MySQL['login'])) && (!defined('mxchange_installing')) && (!REQUEST_I
        OUTPUT_HTML("<div>{--LANG_WARNING--}:</div> {--WARN_NULL_PASSWORD--}");
 }
 
-// Set dummy $_CONFIG array
-$_CONFIG = array(
-       'code_length' => 0,
-       'patch_level' => 0,
-       'last_update' => time()
-);
+// Set dummy config array
+initConfig();
 
 // Set important header_sent
 $GLOBALS['header_sent'] = 0;
@@ -108,7 +103,10 @@ if ((!isInstalling()) && (isInstalled())) {
                                unset($MySQL);
 
                                // Load configuration stuff
-                               mergeConfig(LOAD_CONFIG());
+                               loadConfiguration();
+
+                               // Init session
+                               LOAD_INC_ONCE("inc/session.php");
 
                                // Load "databases" aka static arrays
                                LOAD_INC_ONCE("inc/databases.php");
@@ -139,7 +137,7 @@ if ((!isInstalling()) && (isInstalled())) {
                                }
 
                                // Run the init filter chain
-                               RUN_FILTER('init');
+                               runFilterChain('init');
 
                                // Set default 'what' value
                                //* DEBUG: */ OUTPUT_HTML("-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />");
@@ -162,8 +160,8 @@ if ((!isInstalling()) && (isInstalled())) {
 
                                // Load all active extension including language files when not upgrading.
                                // Check module for testing and count one click
-                               $dummy = CHECK_MODULE($GLOBALS['module']);
-                               if ($dummy == "done") COUNT_MODULE($GLOBALS['module']);
+                               $dummy = checkModulePermissions($GLOBALS['module']);
+                               if ($dummy == "done") countModuleHit($GLOBALS['module']);
                                unset($dummy);
 
                                // Shall we activate the exchange?
@@ -172,10 +170,10 @@ if ((!isInstalling()) && (isInstalled())) {
                                // 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'], ""));
+                                       if (isset(getUserId())) {
+                                               define('RAND_NUMBER', generateRandomCodde(10, mt_rand(10000,32766), getUserId(), ""));
                                        } else {
-                                               define('RAND_NUMBER', GEN_RANDOM_CODE(10, mt_rand(10000,32766), 0, ""));
+                                               define('RAND_NUMBER', generateRandomCodde(10, mt_rand(10000,32766), 0, ""));
                                        }
                                } else {
                                        // Generate weak (!!!) code
@@ -201,6 +199,9 @@ if ((!isInstalling()) && (isInstalled())) {
        // Set other missing variables
        if (!isset($GLOBALS['output_mode'])) $GLOBALS['output_mode'] = "0";
 
+       // Init session
+       LOAD_INC_ONCE("inc/session.php");
+
        // Include databases.php
        LOAD_INC_ONCE("inc/databases.php");
 
@@ -225,10 +226,13 @@ if ((!isInstalling()) && (isInstalled())) {
        } // END - if
 
        // Run the init filter chain
-       RUN_FILTER('init');
+       runFilterChain('init');
+
+       // Load extension 'sql_patches'
+       LOAD_EXTENSION("sql_patches");
 }
 
-if ((getTotalFatalErrors() > 0) && (isInstalled()) && (!defined('mxchange_installing')) && ($GLOBALS['output_mode'] != "1")) {
+if ((getTotalFatalErrors() > 0) && (isInstalled()) && (!isInstalling()) && ($GLOBALS['output_mode'] != "1")) {
        // One or more fatal error(s) occur during connect...
        LOAD_INC_ONCE("inc/header.php");
        LOAD_INC_ONCE("inc/fatal_errors.php");