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 4c23235..e2640ed 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 c73a57f..b342187 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 d096c8e..5088da4 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 d87acc2..8fa1486 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 47d8c45..76499f3 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 0b8b56b..9586233 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