More fixes for extension loader / broken cache files
authorRoland Häder <roland@mxchange.org>
Sat, 13 Dec 2008 00:10:41 +0000 (00:10 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 13 Dec 2008 00:10:41 +0000 (00:10 +0000)
confirm.php
inc/databases.php
inc/extensions.php
inc/extensions/ext-yoomedia.php
inc/load_extensions.php
inc/modules/admin.php
inc/modules/admin/admin-inc.php
inc/modules/login.php
inc/modules/order.php
sponsor_confirm.php

index b6542b63204c40575f2a38d54152f37a827b8e1a..e55e503ee8b6ca6cc2afe00134b91fb04eb562cb 100644 (file)
@@ -45,28 +45,25 @@ $GLOBALS['module'] = "confirm"; $CSS = -1;
 require("inc/config.php");
 
 // Is the script installed?
 require("inc/config.php");
 
 // Is the script installed?
-if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')))
-{
+if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered'))) {
        // Base URL for redirection
        $URL = URL."/modules.php?module=index&what=confirm&hash=";
        // Base URL for redirection
        $URL = URL."/modules.php?module=index&what=confirm&hash=";
-       if (empty($_GET['hash']))
-       {
+       if (empty($_GET['hash'])) {
                // No refid and we add our refid (don't forget to set $def_refid!)
                $URL = URL."/modules.php?module=index";
                // No refid and we add our refid (don't forget to set $def_refid!)
                $URL = URL."/modules.php?module=index";
-       }
-        else
-       {
+       } else {
                // We have an refid here. So we simply add it
                $URL .= $_GET['hash'];
        }
                // We have an refid here. So we simply add it
                $URL .= $_GET['hash'];
        }
+
        // Load the URL
        LOAD_URL($URL);
        // Load the URL
        LOAD_URL($URL);
+
        // Redirection should be done here
        // Redirection should be done here
-}
- else
-{
+} else {
        // You have to configure first!
        LOAD_URL("install.php");
 }
        // You have to configure first!
        LOAD_URL("install.php");
 }
+
 // Really all done here... ;-)
 ?>
 // Really all done here... ;-)
 ?>
index 3062238563695f7628be4636e48777508b5366b6..df2403e1c74cd4bb68e0f15362907526b660903f 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
-define('CURR_SVN_REVISION', "624");
+define('CURR_SVN_REVISION', "625");
 
 // 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 29ea00c7bbc5ec444a870b36f2457c10ef17a0e6..0063ac099786760e5be62c34ecc80122314d61a3 100644 (file)
@@ -42,6 +42,7 @@ function LOAD_EXTENSION ($ext_name) {
        global $EXT_LOADED, $_CONFIG, $CSS, $cacheMode;
 
        // Is the extension already loaded?
        global $EXT_LOADED, $_CONFIG, $CSS, $cacheMode;
 
        // Is the extension already loaded?
+       //* DEBUG: */ echo "Loading extension {$ext_name}.<br />\n";
        if (isset($EXT_LOADED[$ext_name])) {
                // Debug message
                DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Extension %s already loaded.", $ext_name));
        if (isset($EXT_LOADED[$ext_name])) {
                // Debug message
                DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Extension %s already loaded.", $ext_name));
@@ -66,6 +67,7 @@ function LOAD_EXTENSION ($ext_name) {
        // Is this include there?
        if (FILE_READABLE($langInclude)) {
                // Then load it
        // Is this include there?
        if (FILE_READABLE($langInclude)) {
                // Then load it
+               //* DEBUG: */ echo "--- Language loaded.<br />\n";
                require($langInclude);
        } // END - if
 
                require($langInclude);
        } // END - if
 
@@ -75,6 +77,7 @@ function LOAD_EXTENSION ($ext_name) {
        // Is this include there?
        if (FILE_READABLE($funcsInclude)) {
                // Then load it
        // Is this include there?
        if (FILE_READABLE($funcsInclude)) {
                // Then load it
+               //* DEBUG: */ echo "--- Functions loaded.<br />\n";
                require($funcsInclude);
        } // END - if
 
                require($funcsInclude);
        } // END - if
 
@@ -82,6 +85,7 @@ function LOAD_EXTENSION ($ext_name) {
        $EXT_LOAD_MODE = "";
 
        // Include the extension file
        $EXT_LOAD_MODE = "";
 
        // Include the extension file
+       //* DEBUG: */ echo "Extension loaded.<br />\n";
        require($extInclude);
 
        // Mark it as loaded
        require($extInclude);
 
        // Mark it as loaded
index 1b8f602b436ec809163097a4fab3ebe934bdb3d0..92c7cb5c20d6e3ec9215cf034549d8365e579c81 100644 (file)
@@ -47,9 +47,11 @@ if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
 // Version history array (add more with , "0.1" and so on)
 $EXT_VER_HISTORY = array("0.0");
 
 // Version history array (add more with , "0.1" and so on)
 $EXT_VER_HISTORY = array("0.0");
 
+/*
 print "<pre>";
 debug_print_backtrace();
 print "<pre>";
 print "<pre>";
 debug_print_backtrace();
 print "<pre>";
+*/
 
 switch ($EXT_LOAD_MODE)
 {
 
 switch ($EXT_LOAD_MODE)
 {
index bdfa0578e2f59063ee5b31c7166ad1c9413fb734..166aab7a833bb21a3ff1f05edb52a02c888c4832 100644 (file)
@@ -51,6 +51,9 @@ $cacheArray['active_extensions'] = array();
 // By default no cache is set
 $cacheMode = "no";
 
 // By default no cache is set
 $cacheMode = "no";
 
+// Load sql_patchrs extension alone
+LOAD_EXTENSION("sql_patches");
+
 //
 // Load extensions
 //
 //
 // Load extensions
 //
@@ -102,7 +105,7 @@ if ($cacheMode == "load") {
                if ($EXT_DUMMY['ext_css'][$k] == "Y") $EXT_CSS_FILES[] = "".$name.".css";
 
                // Load extension file itself
                if ($EXT_DUMMY['ext_css'][$k] == "Y") $EXT_CSS_FILES[] = "".$name.".css";
 
                // Load extension file itself
-               if (($EXT_DUMMY['ext_active'][$k] == "Y") || ($EXT_DUMMY['ext_keep'][$k] == "Y") || (IS_ADMIN())) {
+               if ((($EXT_DUMMY['ext_active'][$k] == "Y") || ($EXT_DUMMY['ext_keep'][$k] == "Y") || (IS_ADMIN())) && (!in_array($name, array("sql_patches", "cache")))) {
                        $EXT_POOL[] = $name;
                } // END - if
 
                        $EXT_POOL[] = $name;
                } // END - if
 
@@ -205,7 +208,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1")
                        $EXT_ALWAYS_ACTIVE = "N";
 
                        // Load extension
                        $EXT_ALWAYS_ACTIVE = "N";
 
                        // Load extension
-                       if (($content['ext_name'] != "sql_patches") && (($content['ext_name'] == "cache") || (!EXT_IS_ACTIVE("cache")))) {
+                       if (($content['ext_name'] != "sql_patches") && (($content['ext_name'] != "cache") || (!EXT_IS_ACTIVE("cache")))) {
                                // Load extension
                                LOAD_EXTENSION($content['ext_name']);
                        } else {
                                // Load extension
                                LOAD_EXTENSION($content['ext_name']);
                        } else {
index d416353943a48b21069446b62bd7d3bfbfd76d22..ea744f2f33abdc18eb763aea91bd0d1c51d37756 100644 (file)
@@ -96,8 +96,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) {
                                admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
 
                                // Load URL for login
                                admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
 
                                // Load URL for login
-                               $URL = URL."/modules.php?module=admin&amp;action=login";
-                               LOAD_URL($URL);
+                               LOAD_URL(URL."/modules.php?module=admin&amp;action=login");
                        } // END - if
                        break;
                }
                        } // END - if
                        break;
                }
@@ -190,9 +189,9 @@ if (!isBooleanConstantAndTrue('admin_registered')) {
        // At leat one administrator account was created
        if ((isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last')) && (isSessionVariableSet('admin_to'))) {
                // Timeout for last login, we have to logout first!
        // At leat one administrator account was created
        if ((isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last')) && (isSessionVariableSet('admin_to'))) {
                // Timeout for last login, we have to logout first!
-               $URL = URL."/modules.php?module=admin&amp;action=login&amp;logout=1";
-               LOAD_URL($URL);
-       }
+               LOAD_URL(URL."/modules.php?module=admin&amp;action=login&amp;logout=1");
+       } // END - if
+
        if (!empty($_GET['register'])) {
                // Registration of first admin is done
                if ($_GET['register'] == "done") OUTPUT_HTML("<STRONG class=\"admin\">".ADMIN_REGISTER_DONE."</STRONG>");
        if (!empty($_GET['register'])) {
                // Registration of first admin is done
                if ($_GET['register'] == "done") OUTPUT_HTML("<STRONG class=\"admin\">".ADMIN_REGISTER_DONE."</STRONG>");
index 9c8a1810224cdf5f4222744371b83063dce32483..14af3237414228f8f2efd75ce856f50c9af3010d 100644 (file)
@@ -58,8 +58,7 @@ function REGISTER_ADMIN ($user, $md5, $email=WEBMASTER)
        return $ret;
 }
 // Only be executed on login procedure!
        return $ret;
 }
 // Only be executed on login procedure!
-function CHECK_ADMIN_LOGIN ($admin_login, $password)
-{
+function CHECK_ADMIN_LOGIN ($admin_login, $password) {
        global $cacheArray, $_CONFIG, $cacheInstance;
 
        // Init variables
        global $cacheArray, $_CONFIG, $cacheInstance;
 
        // Init variables
index fcf4e9db9c970ffe030b5474f5245e137f4e8dff..cdf0e72676539a3cdb7ef6e8299c01367b6a916b 100644 (file)
@@ -58,8 +58,9 @@ if ($status != "CONFIRMED") {
                $ERROR = CODE_UNKNOWN_STATUS;
                break;
        }
                $ERROR = CODE_UNKNOWN_STATUS;
                break;
        }
-       $URL = URL."/modules.php?module=index&login=".$ERROR;
-       LOAD_URL($URL);
+
+       // Load URL
+       LOAD_URL(URL."/modules.php?module=index&login=".$ERROR);
 } // END - if
 
 // Load adverstising template
 } // END - if
 
 // Load adverstising template
index 6e52c0745d0469b9ab840c3a103fa4491d913df1..e64f2607c4b926e0475bed19b8a3569cfcc39469 100644 (file)
@@ -110,8 +110,7 @@ if (empty($URL)) {
                LOAD_TEMPLATE("member_order-back", false);
        } else {
                // Matching line not found or already "placed" in send queue
                LOAD_TEMPLATE("member_order-back", false);
        } else {
                // Matching line not found or already "placed" in send queue
-               $URL = URL."/modules.php?module=login";
-               LOAD_URL($URL);
+               LOAD_URL(URL."/modules.php?module=login");
        }
 } else {
        // Redirect...
        }
 } else {
        // Redirect...
index e1c9c464389b694a5259bea28a8013ab785f795f..9d1a29222e125ef0e45e2028f3ea8dc1a64f6c23 100644 (file)
@@ -50,8 +50,8 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
 
        // Load the URL
        LOAD_URL($URL);
 
        // Load the URL
        LOAD_URL($URL);
-       // Redirection should be done here
 
 
+       // Redirection should be done here
 } else {
        // You have to configure first!
        LOAD_URL(URL."/install.php");
 } else {
        // You have to configure first!
        LOAD_URL(URL."/install.php");