From: Roland Häder Date: Sat, 13 Dec 2008 00:10:41 +0000 (+0000) Subject: More fixes for extension loader / broken cache files X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=49c0cfbada5ede43152c053139b32f92441f8e45 More fixes for extension loader / broken cache files --- diff --git a/confirm.php b/confirm.php index b6542b6320..e55e503ee8 100644 --- a/confirm.php +++ b/confirm.php @@ -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... ;-) ?> diff --git a/inc/databases.php b/inc/databases.php index 3062238563..df2403e1c7 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -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); diff --git a/inc/extensions.php b/inc/extensions.php index 29ea00c7bb..0063ac0997 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -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}.
\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.
\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.
\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.
\n"; require($extInclude); // Mark it as loaded diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index 1b8f602b43..92c7cb5c20 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -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 "
";
 debug_print_backtrace();
 print "
";
+*/
 
 switch ($EXT_LOAD_MODE)
 {
diff --git a/inc/load_extensions.php b/inc/load_extensions.php
index bdfa0578e2..166aab7a83 100644
--- a/inc/load_extensions.php
+++ b/inc/load_extensions.php
@@ -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 {
diff --git a/inc/modules/admin.php b/inc/modules/admin.php
index d416353943..ea744f2f33 100644
--- a/inc/modules/admin.php
+++ b/inc/modules/admin.php
@@ -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&action=login";
-				LOAD_URL($URL);
+				LOAD_URL(URL."/modules.php?module=admin&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&action=login&logout=1";
-		LOAD_URL($URL);
-	}
+		LOAD_URL(URL."/modules.php?module=admin&action=login&logout=1");
+	} // END - if
+
 	if (!empty($_GET['register'])) {
 		// Registration of first admin is done
 		if ($_GET['register'] == "done") OUTPUT_HTML("".ADMIN_REGISTER_DONE."");
diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php
index 9c8a181022..14af323741 100644
--- a/inc/modules/admin/admin-inc.php
+++ b/inc/modules/admin/admin-inc.php
@@ -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
diff --git a/inc/modules/login.php b/inc/modules/login.php
index fcf4e9db9c..cdf0e72676 100644
--- a/inc/modules/login.php
+++ b/inc/modules/login.php
@@ -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
diff --git a/inc/modules/order.php b/inc/modules/order.php
index 6e52c0745d..e64f2607c4 100644
--- a/inc/modules/order.php
+++ b/inc/modules/order.php
@@ -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...
diff --git a/sponsor_confirm.php b/sponsor_confirm.php
index e1c9c46438..9d1a29222e 100644
--- a/sponsor_confirm.php
+++ b/sponsor_confirm.php
@@ -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");