Fixes for 'empty extension version bug'
authorRoland Häder <roland@mxchange.org>
Sun, 29 Nov 2009 14:44:05 +0000 (14:44 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 29 Nov 2009 14:44:05 +0000 (14:44 +0000)
inc/classes/cachesystem.class.php
inc/extensions-functions.php
inc/filter-functions.php
inc/header.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php

index 4c23235ac20812d568c89b9d06066dcd36354f5e..e2640ed3d710747ead9cce4b280d6a24ac461af0 100644 (file)
@@ -89,8 +89,8 @@ class CacheSystem {
                        // Pre-fetch cache here if found
                        if ($this->isCacheReadable()) $this->getArrayFromCache();
 
-                       //* DEBUG: */ print($cacheName.'='.intval($this->isCacheReadable()).'/'.intval(is_writeable($this->fqfn)).'/'.intval($this->extensionVersionMatches('cache')).'<br />');
-                       $this->status[$cacheName] = ($this->isCacheReadable() && (is_writeable($this->fqfn)) && ($this->extensionVersionMatches('cache')));
+                       //* DEBUG: */ print($cacheName.'='.intval($this->isCacheReadable()).'/'.intval(is_writeable($this->fqfn)).'/'.intval(isExtensionInstalled('cache')).'/'.intval($this->extensionVersionMatches('cache')).'<br />');
+                       $this->status[$cacheName] = ($this->isCacheReadable() && (is_writeable($this->fqfn)) && (isExtensionInstalled('cache')) && ($this->extensionVersionMatches('cache')));
                } // END - if
                //* DEBUG: */ print($cacheName.'='.intval($this->status[$cacheName]).'<br />');
 
index c73a57fe4c3bc0d2adbbc45b50623c868a5f61d3..b3421876b54d6f09679de0b2da6e08775bd1d7e9 100644 (file)
@@ -682,7 +682,7 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
        $OUT = '';
 
        // Do we have queries?
-       if ((getExtensionVersion('sql_patches') >= '0.0.7') && (getConfig('verbose_sql') == 'Y')) {
+       if ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) {
                // Init switch color
                $SW = 2;
 
@@ -721,7 +721,7 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
 
                // Load main template
                $OUT = loadTemplate('admin_ext_sql_table', true, $content);
-       } elseif ((getExtensionVersion('sql_patches') >= '0.0.7') && (getConfig('verbose_sql') == 'Y')) {
+       } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) {
                // No addional SQL commands to run
                $OUT = loadTemplate('admin_settings_saved', true, getMessage('ADMIN_NO_ADDITIONAL_SQLS'));
        } // END - if
index d096c8e43bb0c1fe74a1bfb1fcc021254a44b247..5088da4b23bb3f860f015ca70b36fe1d1bd12a89 100644 (file)
@@ -118,9 +118,9 @@ ORDER BY
 
        // Init filters
        registerFilter('init', 'LOAD_CONFIGURATION');
+       registerFilter('init', 'LOAD_RUNTIME_INCLUDES');
        registerFilter('init', 'INIT_EXTENSIONS');
        registerFilter('init', 'INIT_RANDOMIZER');
-       registerFilter('init', 'LOAD_RUNTIME_INCLUDES');
        registerFilter('init', 'INIT_RANDOM_NUMBER');
        registerFilter('init', 'CHECK_SVN_REVISION');
        registerFilter('init', 'RUN_DAILY_RESET');
index d87acc2edd4c7cec0b34a2d2d8c9132e16364fa8..8fa1486a728132568023dcc1b5a7b632fee2337d 100644 (file)
@@ -43,6 +43,9 @@ if (!defined('__SECURITY')) {
        die();
 } // END - if
 
+// Init header
+$GLOBALS['page_header'] = '';
+
 // Is the header already sent?
 if (($GLOBALS['header_sent'] != 1) && ($GLOBALS['header_sent'] != 2)) {
        // If not in CSS mode generate the header
index 47d8c45e2dc14dc4f1ebcc0616a53cea01489c42..76499f3675ce018c631fd1f9acf8d12575b24bd4 100644 (file)
@@ -197,7 +197,7 @@ function ifAdminLoginDataIsValid ($admin, $password) {
 // Try to login the admin by setting some session/cookie variables
 function doAdminLogin ($adminLogin, $passHash) {
        // Reset failure counter on matching admins version
-       if ((isExtensionInstalledAndNewer('admins', '0.7.0')) && ((isExtensionOlder('sql_patches', '0.3.6')) || (!isExtensionInstalled('sql_patches')))) {
+       if ((isExtensionInstalledAndNewer('admins', '0.7.0')) && ((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) || (!isExtensionInstalled('sql_patches')))) {
                // Reset counter on out-dated sql_patches version
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `login_failures`=0, `last_failure`='0000-00-00 00:00:00' WHERE `login`='%s' LIMIT 1",
                        array($adminLogin), __FUNCTION__, __LINE__);
index 0b8b56becdb2463777a43bf48c5af4d685107e10..9586233e835ad9db0a8664566aed5fd1fe1cee5f 100644 (file)
@@ -242,9 +242,9 @@ LIMIT 1",
                                        }
 
                                        // Add SQLs to a table
-                                       if ((!empty($ext_name)) && (getExtensionVersion('sql_patches')) && (getConfig('verbose_sql') == 'Y')) {
+                                       if ((!empty($ext_name)) && (isExtensionInstalled('sql_patches')) && (getConfig('verbose_sql') == 'Y')) {
                                                // Add verbose SQL table
-                                               $text .= addExtensionVerboseSqlTable($title, " class=\"admin_table top left right\"", true, '100%') . "<br />\n";
+                                               $text .= addExtensionVerboseSqlTable($title, ' class="admin_table top left right"', true, '100%') . "<br />\n";
                                        } // END - if
                                } elseif ((!empty($ext_name)) && (!empty($ext_ver))) {
                                        // Run SQL commands in dry mode but only return the notes