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 b6542b6..e55e503 100644 (file)
@@ -45,28 +45,25 @@ $GLOBALS['module'] = "confirm"; $CSS = -1;
 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=";
-       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";
-       }
-        else
-       {
+       } else {
                // We have an refid here. So we simply add it
                $URL .= $_GET['hash'];
        }
+
        // Load the URL
        LOAD_URL($URL);
+
        // Redirection should be done here
-}
- else
-{
+} else {
        // You have to configure first!
        LOAD_URL("install.php");
 }
+
 // Really all done here... ;-)
 ?>
index 3062238..df2403e 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 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);
index 29ea00c..0063ac0 100644 (file)
@@ -42,6 +42,7 @@ function LOAD_EXTENSION ($ext_name) {
        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));
@@ -66,6 +67,7 @@ function LOAD_EXTENSION ($ext_name) {
        // Is this include there?
        if (FILE_READABLE($langInclude)) {
                // Then load it
+               //* DEBUG: */ echo "--- Language loaded.<br />\n";
                require($langInclude);
        } // END - if
 
@@ -75,6 +77,7 @@ function LOAD_EXTENSION ($ext_name) {
        // Is this include there?
        if (FILE_READABLE($funcsInclude)) {
                // Then load it
+               //* DEBUG: */ echo "--- Functions loaded.<br />\n";
                require($funcsInclude);
        } // END - if
 
@@ -82,6 +85,7 @@ function LOAD_EXTENSION ($ext_name) {
        $EXT_LOAD_MODE = "";
 
        // Include the extension file
+       //* DEBUG: */ echo "Extension loaded.<br />\n";
        require($extInclude);
 
        // Mark it as loaded
index 1b8f602..92c7cb5 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");
 
+/*
 print "<pre>";
 debug_print_backtrace();
 print "<pre>";
+*/
 
 switch ($EXT_LOAD_MODE)
 {
index bdfa057..166aab7 100644 (file)
@@ -51,6 +51,9 @@ $cacheArray['active_extensions'] = array();
 // By default no cache is set
 $cacheMode = "no";
 
+// Load sql_patchrs extension alone
+LOAD_EXTENSION("sql_patches");
+
 //
 // 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_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
 
@@ -205,7 +208,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1")
                        $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 {
index d416353..ea744f2 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
-                               $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;
                }
@@ -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!
-               $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>");
index 9c8a181..14af323 100644 (file)
@@ -58,8 +58,7 @@ function REGISTER_ADMIN ($user, $md5, $email=WEBMASTER)
        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
index fcf4e9d..cdf0e72 100644 (file)
@@ -58,8 +58,9 @@ if ($status != "CONFIRMED") {
                $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
index 6e52c07..e64f260 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
-               $URL = URL."/modules.php?module=login";
-               LOAD_URL($URL);
+               LOAD_URL(URL."/modules.php?module=login");
        }
 } else {
        // Redirect...
index e1c9c46..9d1a292 100644 (file)
@@ -50,8 +50,8 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
 
        // 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");