]> git.mxchange.org Git - mailer.git/commitdiff
More fixes applied from profi-conecpt, cache system rewritten: now all cache files...
authorRoland Häder <roland@mxchange.org>
Fri, 5 Dec 2008 21:10:00 +0000 (21:10 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 5 Dec 2008 21:10:00 +0000 (21:10 +0000)
25 files changed:
inc/databases.php
inc/extensions.php
inc/extensions/ext-cache.php
inc/extensions/ext-sql_patches.php
inc/functions.php
inc/libs/admins_functions.php
inc/libs/cache_functions.php
inc/libs/refback_functions.php
inc/load_extensions.php
inc/loader/load_cache-admin.php
inc/loader/load_cache-config.php
inc/loader/load_cache-modreg.php
inc/loader/load_cache-refdepths.php
inc/loader/load_cache-refsystem.php
inc/loader/load_cache-them.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-admins_add.php
inc/modules/admin/what-config_admins.php
inc/modules/admin/what-config_cache.php
inc/modules/admin/what-config_mods.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-extensions.php
inc/mysql-manager.php
templates/de/html/install/install_page2.tpl
templates/de/html/install/install_page3.tpl

index 1419c54ffbca19ba73e761a3b85b4b770cf1d050..d1341d0e3e335381be905eaeff7057bb4b7ae280 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
-define('CURR_SVN_REVISION', "599");
+define('CURR_SVN_REVISION', "600");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 9d2c0a44184b7fb6932aca4acb3dfab530ec9497..cfe82ae48efecd04076eb52701b78d3633ef19c8 100644 (file)
@@ -202,8 +202,8 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
                                        //* DEBUG: */ echo __LINE__.": DESTROY!<br />\n";
                                        // Remove cache files
                                        if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
-                                       if ($cacheInstance->cache_file("mod_reg", true))    $cacheInstance->cache_destroy();
-                                       if ($cacheInstance->cache_file("config", true))     $cacheInstance->cache_destroy();
+                                       if ($cacheInstance->cache_file("mod_reg")) $cacheInstance->cache_destroy();
+                                       if ($cacheInstance->cache_file("config")) $cacheInstance->cache_destroy();
                                } // END - if
 
                                // Check for added include files
@@ -339,8 +339,8 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
                //* DEBUG: */ echo __LINE__.": DESTROY!<br />\n";
                // Remove cache files
                if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
-               if ($cacheInstance->cache_file("mod_reg", true))    $cacheInstance->cache_destroy();
-               if ($cacheInstance->cache_file("config", true))     $cacheInstance->cache_destroy();
+               if ($cacheInstance->cache_file("mod_reg"))    $cacheInstance->cache_destroy();
+               if ($cacheInstance->cache_file("config"))     $cacheInstance->cache_destroy();
 
                // @TODO This causes the whole (!) menu cache being purged
                CACHE_PURGE_ADMIN_MENU();
@@ -537,9 +537,9 @@ function EXTENSION_UPDATE($file, $ext, $EXT_VER, $dry_run=false)
 
                        // Update cache
                        if (EXT_IS_ACTIVE("cache")) {
-                               if ($cacheInstance->cache_file("extensions", true) == true) $cacheInstance->cache_destroy();
-                               if ($cacheInstance->cache_file("config", true) == true)     $cacheInstance->cache_destroy();
-                               if ($cacheInstance->cache_file("mod_reg", true) == true)    $cacheInstance->cache_destroy();
+                               if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
+                               if ($cacheInstance->cache_file("config")) $cacheInstance->cache_destroy();
+                               if ($cacheInstance->cache_file("mod_reg")) $cacheInstance->cache_destroy();
                        } // END - if
 
                        // Remove array
index 7cda547dcd940cec074e18c1eb663cbf42249885..9bfd6e0459e2252c3699a3d0a926536dc6a3f297 100644 (file)
@@ -39,13 +39,13 @@ if (!defined('__SECURITY')) {
 }
 
 // Version number
-$EXT_VERSION = "0.1.9";
+$EXT_VERSION = "0.2.0";
 
 // Auto-set extension version
 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", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9");
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0");
 
 switch ($EXT_LOAD_MODE)
 {
@@ -92,11 +92,10 @@ case "update": // Update an extension
 
        case "0.0.4": // SQL queries for v0.0.4
                // Update notes (these will be set as task text!)
-               if (EXT_IS_ACTIVE("cache"))
-               {
+               if (EXT_IS_ACTIVE("cache")) {
                        // Check for cache when extension is already installed
                        if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
-               }
+               } // END - if
                $UPDATE_NOTES = "Spalte &quot;keep_active&quot; ist hinzugef&uuml;gt. Cache wurde reinitialisiert.";
                break;
 
@@ -190,6 +189,14 @@ case "update": // Update an extension
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Administratormen&uuml; experimentell gecacht.";
                break;
+
+       case "0.2.0": // SQL queries for v0.2.0
+               // This update depends on sql_patches
+               $EXT_UPDATE_DEPENDS = "sql_patches";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Die Erweiterung h&auml;ngt nun von der <strong>sql_patches</strong> ab.";
+               break;
        }
        break;
 
index 8d8b5cc467dd29350f5112d9b4a3fd27129eeb97..c35f2ffe254db2b3faa9e22596b947a7000815e6 100644 (file)
@@ -727,7 +727,7 @@ default: // Do stuff when extension is loaded
                                require_once(PATH."inc/libs/cache_functions.php");
                                require_once(PATH."inc/extensions/ext-cache.php");
                                if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
-                               if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy();
+                               if ($cacheInstance->cache_file("mod_reg")) $cacheInstance->cache_destroy();
                        } // END - if
                } // END - if
 
index 65d558956bf1951c789ea2d7e4ac48c36dd85c1d..5b3b3855c384f2dbf1d16755a509c00ece02148c 100644 (file)
@@ -2602,7 +2602,7 @@ function REBUILD_CACHE ($cache, $inc="") {
        // Shall I remove the cache file?
        if ((EXT_IS_ACTIVE("cache")) && (is_object($cacheInstance))) {
                // Rebuild cache
-               if ($cacheInstance->cache_file($cache, true)) {
+               if ($cacheInstance->cache_file($cache)) {
                        // Destroy it
                        $cacheInstance->cache_destroy();
                } // END - if
index e83bb3d1b92b3ef6346d9952e95f9f5f83fb7df7..535adf41acd8ab806f7211a3930aa105da24224d 100644 (file)
@@ -255,7 +255,7 @@ WHERE id=%s LIMIT 1",
 
        // Remove cache file
        if ((EXT_IS_ACTIVE("cache")) && ($cache_update == "1")) {
-               if ($cacheInstance->cache_file("admins", true)) $cacheInstance->cache_destroy();
+               if ($cacheInstance->cache_file("admins")) $cacheInstance->cache_destroy();
        }
 }
 
@@ -368,7 +368,7 @@ function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) {
 
        // Remove cache if cache system is activated
        if ((EXT_IS_ACTIVE("cache")) && ($cache_update == "1")) {
-               if ($cacheInstance->cache_file("admins", true)) $cacheInstance->cache_destroy();
+               if ($cacheInstance->cache_file("admins")) $cacheInstance->cache_destroy();
        }
 }
 
index a3b1d0a15e77831db0bf6c1d430869a2d2f426d6..88b506223d9f6fdd1ecf162e97de9a05ddf664ad 100644 (file)
@@ -49,6 +49,7 @@ class mxchange_cache
        var $cache_pointer = false;
        var $cache_data = "";
        var $cache_version = "";
+       var $cache_file = "";
 
        // Constructor
        function mxchange_cache($interval, $path, $tested) {
@@ -87,8 +88,11 @@ class mxchange_cache
                }
        }
 
-       function cache_file($file, $ignore_ctime=false) {
-               global $INC;
+       // Checks validity of cache file and if content is given
+       function cache_file ($file, $forceContent = false) {
+               // Remember cache file
+               $this->cache_file = $file;
+
                // Construct FQFN (full qualified file name)
                $inc = $this->cache_path.$file.".cache";
 
@@ -109,10 +113,10 @@ class mxchange_cache
                $this->cache_ctime = $ctime;
 
                // Is the cache file outdated?
-               if (((time() - $ctime) >= $this->update_interval) && (!$ignore_ctime)) {
+               if (($status) && ((time() - $ctime) >= $this->update_interval)) {
                        // Ok, we need an update!
                        $status = false;
-               }
+               } // END - if
 
                // Return status
                return $status;
@@ -196,23 +200,29 @@ class mxchange_cache
                        $cache_version = null;
 
                        // Load cache file
-                       $this->cache_data = implode("", file($this->cache_inc));
+                       $this->cache_data[$this->cache_file] = implode("", file($this->cache_inc));
 
                        // Execute cache file
-                       eval($this->cache_data);
+                       eval($this->cache_data[$this->cache_file]);
 
                        if (is_array($data)) {
                                // Cache data
-                               $this->cache_data = $data;
+                               $this->cache_data[$this->cache_file] = $data;
 
                                // Cache version found?
-                               if ((isset($cache_version)) && (is_array($cache_version))) {
+                               if ((is_array($cache_version)) && (count($cache_version) > 0)) {
                                        // Remember it as well...
-                                       $this->cache_version = $cache_version;
-                               } // END - if
+                                       $this->cache_version[$this->cache_file] = $cache_version;
+                               } else {
+                                       // Invalid cache so destroy it
+                                       $this->cache_destroy();
+
+                                       // Clear cached data
+                                       $this->cache_data[$this->cache_file] = array();
+                               }
 
                                // Return cache
-                               return $this->cache_data;
+                               return $this->cache_data[$this->cache_file];
                        } else {
                                // Cache problem detected!
                                $this->cache_destroy();
@@ -242,8 +252,7 @@ class mxchange_cache
                }
        }
 
-       function cache_remove($search, $data, $array)
-       {
+       function cache_remove($search, $data, $array) {
                global $ARRAY;
                if ((FILE_READABLE($this->cache_inc)) && (is_writeable($this->cache_inc))) {
                        // Load cache into dummy array
@@ -287,8 +296,7 @@ class mxchange_cache
                }
        }
 
-       function cache_replace($search, $replace, $search_key, $array)
-       {
+       function cache_replace($search, $replace, $search_key, $array) {
                global $ARRAY;
                if ((FILE_READABLE($this->cache_inc)) && (is_writeable($this->cache_inc)))
                {
@@ -361,9 +369,8 @@ class mxchange_cache
                // Get extension version
                $ext_ver = GET_EXT_VERSION($ext_name);
 
-               //* DEBUG: */ echo __METHOD__.": ext_name={$ext_name},ext_ver={$ext_ver},cache_version={$this->cache_version}<br />\n";
                // Compare both
-               return ((isset($this->cache_version[$ext_name])) && ($this->cache_version[$ext_name] == $ext_ver));
+               return ((isset($this->cache_version[$this->cache_file][$ext_name])) && ($this->cache_version[$this->cache_file][$ext_name] == $ext_ver));
        }
 
        function add_raw_row ($key, $value) {
index e7a2b5987bf3b957f851c299611117299e4f089e..469b04d304a6afa5213c46534416039711bfbb47 100644 (file)
@@ -247,7 +247,7 @@ function UPDATE_REFBACK_TABLE($uid) {
        if ((($cacheArray['up_refid'][$cacheArray['back_level']] == $uid) || ($cacheArray['up_refid'][$cacheArray['back_level']] == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2") && (!isset($cacheArray['back_cached']))) {
                // Remove cache here
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - CACHE!<br />\n";
-               if ($cacheInstance->cache_file("refback", true)) $cacheInstance->cache_destroy();
+               if ($cacheInstance->cache_file("refback")) $cacheInstance->cache_destroy();
                $cacheArray['back_cached'] = 1;
        } // END - if
 
index e7d7e0b9003cff8fa6f04f65c7041bcee1d1e2db..87f1179fb1e3d431d2e58342842f350b4c80184b 100644 (file)
@@ -64,7 +64,7 @@ if (EXT_IS_ACTIVE("cache")) {
        include_once(PATH."inc/libs/cache_functions.php");
        $cacheMode = "";
        include_once(PATH."inc/extensions/ext-cache.php");
-       switch($cacheInstance->cache_file("extensions", true)) {
+       switch (($cacheInstance->cache_file("extensions", true)) && ($cacheInstance->ext_version_matches("sql_patches"))) {
                case true : $cacheMode = "load"; break;
                case false: $cacheMode = "init"; break;
        }
@@ -75,6 +75,7 @@ if (EXT_IS_ACTIVE("cache")) {
        if ($cacheMode == "init") {
                // Init cache file
                $cacheInstance->cache_init("EXTENSIONS");
+               $cacheInstance->store_extension_version("sql_patches");
 
                if ($_CONFIG['cache_exts'] == "N") $cacheMode = "skip";
        } // END - if
@@ -94,6 +95,15 @@ if ($cacheMode == "load") {
        // Load extension data from cache file
        $EXT_DUMMY = $cacheInstance->cache_load();
 
+       // Is the cache file fine?
+       if (!isset($EXT_DUMMY['ext_name'])) {
+               // Cache file is damaged so kill it
+               $cacheInstance->cache_destroy();
+
+               // Skip any further execution
+               return;
+       } // END -  if
+
        // Begin with the cache preparation of extensions
        $EXT_NAMES = array();
        foreach ($EXT_DUMMY['ext_name'] as $k => $name) {
@@ -108,7 +118,7 @@ if ($cacheMode == "load") {
                        if (FILE_READABLE($INC)) {
                                // Add it
                                $EXT_POOL[] = $INC;
-                       }
+                       } // END -  if
                } // END - if
 
                // Load CSS file
@@ -122,12 +132,15 @@ if ($cacheMode == "load") {
                // Version number
                $EXT_DUMMY['ext_version'][$name] = $EXT_DUMMY['ext_version'][$k];
                unset($EXT_DUMMY['ext_version'][$k]);
+
                // Extension is active
                $EXT_DUMMY['ext_active'][$name] = $EXT_DUMMY['ext_active'][$k];
                unset($EXT_DUMMY['ext_active'][$k]);
+
                // Ext menu
                $EXT_DUMMY['ext_menu'][$name] = $EXT_DUMMY['ext_menu'][$k];
                unset($EXT_DUMMY['ext_menu'][$k]);
+
                // Extension id
                $EXT_DUMMY['ext_id'][$name] = $EXT_DUMMY['ext_id'][$k];
                $id = $EXT_DUMMY['ext_id'][$name];
@@ -296,7 +309,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1")
 
        // Free memory
        SQL_FREERESULT($res_ext_crt);
-}
+} // END - if
 
 // Load include files if found
 if (!empty($INC_POOL[0])) {
index b9cbd32f4ba18e79e689bfe6b42c5a5f8405b72b..7e28bda282bd971f1cb55bd5bda7f4a72061ed13 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Let's start with the admins table...
-if (($cacheInstance->cache_file("admins", true) == true) && ($cacheInstance->ext_version_matches("admins"))) {
+if (($cacheInstance->cache_file("admins")) && ($cacheInstance->ext_version_matches("admins"))) {
        // Load cache
        global $cacheArray;
        $cacheArray['admins'] = $cacheInstance->cache_load();
@@ -116,13 +116,14 @@ $cacheInstance->cache_close();
 // Next cached table are the admins_acls...
 if (GET_EXT_VERSION("admins") >= "0.3") {
        // Check for cache file
-       if ($cacheInstance->cache_file("admins_acls", true) == true) {
+       if (($cacheInstance->cache_file("admins_acls")) && ($cacheInstance->ext_version_matches("admins"))) {
                // Load referal system from cache
                global $cacheArray;
                $cacheArray['admin_acls'] = $cacheInstance->cache_load();
        } elseif (($_CONFIG['cache_acls'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
                // Create cache file here
                $cacheInstance->cache_init("ADMINS_ACLS");
+               $cacheInstance->store_extension_version("admins");
 
                // Load all modules and their data
                $result = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM "._MYSQL_PREFIX."_admins_acls ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__);
index 8139855b7fe002d44eff4c37dfe25f77f2168157..a8ca165691d92f3c1bf03b3b16fb935ef8b1609f 100644 (file)
@@ -38,16 +38,19 @@ if (!defined('__SECURITY')) {
 }
 
 // Next cached table is the configuration (config)...
-if ($cacheInstance->cache_file("config", true) == true) {
+if (($cacheInstance->cache_file("config", true)) && ($cacheInstance->ext_version_matches("sql_patches"))) {
        // Load config from cache
        global $cacheArray;
-       $cacheArrayConfig = $cacheInstance->cache_load();
+       $cacheArray['config'] = $cacheInstance->cache_load();
+
+       // TODO: Do we really need to cache the config???
 } elseif (($_CONFIG['cache_config'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
        // Create cache file here
        $cacheInstance->cache_init("CONFIG");
+       $cacheInstance->store_extension_version("sql_patches");
 
        // Load all modules and their data
-       $result = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX."_config ORDER BY config", __FILE__, __LINE__);
+       $result = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX."_config ORDER BY config ASC", __FILE__, __LINE__);
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
                $cacheInstance->add_row($data);
index ed6797493d6bd3e873241e504632ee60c31e7ca8..126888ba9bfe80cee68e7fb33c46b0127b6fcedb 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Next cached table is the module registry (mod_reg)...
-if ($cacheInstance->cache_file("mod_reg", true) == true) {
+if (($cacheInstance->cache_file("mod_reg")) && ($cacheInstance->ext_version_matches("sql_patches"))) {
        // Load cache
        global $cacheArray;
        $cacheArray['modules'] = $cacheInstance->cache_load();
@@ -67,6 +67,7 @@ if ($cacheInstance->cache_file("mod_reg", true) == true) {
 } elseif (($_CONFIG['cache_modreg'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
        // Create cache file here
        $cacheInstance->cache_init("MODULES");
+       $cacheInstance->store_extension_version("sql_patches");
 
        // Load all modules and their data
        if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
index 3d1dc5e19ca5c7a3ab6a8e3a93f17b22de1a18c1..973e7cbedad7355ce312c1701147451201dec5ce 100644 (file)
@@ -38,13 +38,14 @@ if (!defined('__SECURITY')) {
 }
 
 // Next cached table is the referal system (refdepths)...
-if ($cacheInstance->cache_file("refdepths", true) == true) {
+if (($cacheInstance->cache_file("refdepths")) && ($cacheInstance->ext_version_matches("sql_patches"))) {
        // Load referal system from cache
        global $cacheArray;
        $cacheArray['ref_depths'] = $cacheInstance->cache_load();
 } elseif (($_CONFIG['cache_refdepth'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
        // Create cache file here
        $cacheInstance->cache_init("REFDEPTHS");
+       $cacheInstance->store_extension_version("sql_patches");
 
        // Load all modules and their data
        $result = SQL_QUERY("SELECT id, level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
index 5d8c7d12efc0cd6a65f3d27f7e0d5355e178eb2a..c012c7926db3f82cb70f8bbda81ebdd0ea6b4434 100644 (file)
@@ -38,13 +38,14 @@ if (!defined('__SECURITY')) {
 }
 
 // Next cached table is the referal system (refsystem)...
-if ($cacheInstance->cache_file("refsystem", true) == true) {
+if (($cacheInstance->cache_file("refsystem")) && ($cacheInstance->ext_version_matches("sql_patches"))) {
        // Load referal system from cache
        global $cacheArray;
        $cacheArray['ref_system'] = $cacheInstance->cache_load();
 } elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
        // Create cache file here
        $cacheInstance->cache_init("REFSYSTEM");
+       $cacheInstance->store_extension_version("sql_patches");
 
        // Load all modules and their data
        $result = SQL_QUERY("SELECT id, userid, level, counter FROM "._MYSQL_PREFIX."_refsystem ORDER BY userid, level", __FILE__, __LINE__);
index 61b30df9378c859a45389698f05347741312d4ca..fde1f1bc54627c016f6ac8aae65d2f7151e5088f 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Next cached table is the referal system (themes)...
-if (($cacheInstance->cache_file("themes", true) == true) && ($cacheInstance->ext_version_matches("theme"))) {
+if (($cacheInstance->cache_file("themes")) && ($cacheInstance->ext_version_matches("theme"))) {
        // Load referal system from cache
        global $cacheArray;
        $cache = $cacheInstance->cache_load();
index 9b745c7f3adf2b79909cf23337582932873518e5..970dd69ff5ef87e460c4a93bc1f47ab8bf20ea4a 100644 (file)
@@ -389,7 +389,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
                $cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login'));
 
                // Is that cache there?
-               if ($cacheInstance->cache_file($cacheName, true)) {
+               if ($cacheInstance->cache_file($cacheName)) {
                        // Then load it
                        $data = $cacheInstance->cache_load();
 
index fad779b17f607d531364162542f3429bf377dfe7..45fd36eaafae9afcad275bda6af21420463ed7e9 100644 (file)
@@ -45,13 +45,11 @@ global $cacheInstance;
 // Display form is default
 $FORM = true;
 
-if ((isset($_POST['add'])) && (!empty($_POST['login'])) && (!empty($_POST['email'])) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2'])) && ($_POST['pass1'] == $_POST['pass2']))
-{
+if ((isset($_POST['add'])) && (!empty($_POST['login'])) && (!empty($_POST['email'])) && (!empty($_POST['pass1'])) && (!empty($_POST['pass2'])) && ($_POST['pass1'] == $_POST['pass2'])) {
        // Add admin when not added already
        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admins WHERE login='%s' LIMIT 1",
-        array($_POST['login']), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == 0)
-       {
+               array($_POST['login']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 0) {
                // Login does not exist so we can create it.
                $FORM = false;
                $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins (login, password, email) VALUES ('%s','%s','%s')",
@@ -61,20 +59,16 @@ if ((isset($_POST['add'])) && (!empty($_POST['login'])) && (!empty($_POST['email
                LOAD_TEMPLATE("admin_settings_saved", false, "<FONT class=\"admin_done\">".ADMIN_ADMINS_ADD_DONE."</FONT>");
 
                // Remove cache file
-               if (EXT_IS_ACTIVE("cache"))
-               {
-                       if ($cacheInstance->cache_file("admins", true)) $cacheInstance->cache_destroy();
+               if (EXT_IS_ACTIVE("cache")) {
+                       if ($cacheInstance->cache_file("admins")) $cacheInstance->cache_destroy();
                }
-       }
-        else
-       {
+       } else {
                // Free memory
                SQL_FREERESULT($result);
        }
 }
 
-if ($FORM)
-{
+if ($FORM) {
        // Clear unset variables
        if (empty($_POST['login'])) $_POST['login'] = "";
        if (empty($_POST['email'])) $_POST['email'] = "";
index c531b3b30f38253689b33baaa3e071c77eac4638..05ca3dd2dd746f129e5d52742c0f95aa6f4eef97 100644 (file)
@@ -89,7 +89,7 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) {
 
        // Update cache when installed
        if (EXT_IS_ACTIVE("cache")) {
-               if ($cacheInstance->cache_file("admins_acls", true) == true) $cacheInstance->cache_destroy();
+               if ($cacheInstance->cache_file("admins_acls")) $cacheInstance->cache_destroy();
 
                // Purge menu cache
                CACHE_PURGE_ADMIN_MENU($_POST['admin'][$id]);
@@ -151,7 +151,7 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) {
 
        // Update cache when installed
        if (EXT_IS_ACTIVE("cache")) {
-               if ($cacheInstance->cache_file("admins_acls", true) == true) $cacheInstance->cache_destroy();
+               if ($cacheInstance->cache_file("admins_acls")) $cacheInstance->cache_destroy();
 
                // @TODO This causes the whole (!) menu cache being rebuild
                CACHE_PURGE_ADMIN_MENU();
@@ -191,7 +191,7 @@ VALUES ('%s','%s','%s','%s')",
 
                                // Update cache when installed
                                if (EXT_IS_ACTIVE("cache")) {
-                                       if ($cacheInstance->cache_file("admins_acls", true) == true) $cacheInstance->cache_destroy();
+                                       if ($cacheInstance->cache_file("admins_acls")) $cacheInstance->cache_destroy();
 
                                        // Purge cache
                                        CACHE_PURGE_ADMIN_MENU($_POST['admin_id'], $_POST['action_menu'], $_POST['what_menu']);
index da06438288c2c58fa892072ac46f8339c80f94b4..27b9f6d9a9effc8ed69fc9b3a5210533b4faa8b4 100644 (file)
@@ -51,25 +51,25 @@ if (isset($_POST['ok'])) {
        }
 
        // Delete deactivated cache files
-       if (($_POST['cache_admins'] == "N") && ($cacheInstance->cache_file("admins", true))) {
+       if (($_POST['cache_admins'] == "N") && ($cacheInstance->cache_file("admins"))) {
                $cacheInstance->cache_destroy();
        }
-       if (($_POST['cache_acls'] == "N") && ($cacheInstance->cache_file("acls", true))) {
+       if (($_POST['cache_acls'] == "N") && ($cacheInstance->cache_file("acls"))) {
                $cacheInstance->cache_destroy();
        }
        if (($_POST['cache_exts'] == "N") && ($cacheInstance->cache_file("extensions", true))) {
                $cacheInstance->cache_destroy();
        }
-       if (($_POST['cache_config'] == "N") && ($cacheInstance->cache_file("config", true))) {
+       if (($_POST['cache_config'] == "N") && ($cacheInstance->cache_file("config"))) {
                $cacheInstance->cache_destroy();
        }
-       if (($_POST['cache_modreg'] == "N") && ($cacheInstance->cache_file("modreg", true))) {
+       if (($_POST['cache_modreg'] == "N") && ($cacheInstance->cache_file("modreg"))) {
                $cacheInstance->cache_destroy();
        }
-       if (($_POST['cache_refdepth'] == "N") && ($cacheInstance->cache_file("refdepth", true))) {
+       if (($_POST['cache_refdepth'] == "N") && ($cacheInstance->cache_file("refdepth"))) {
                $cacheInstance->cache_destroy();
        }
-       if (($_POST['cache_refsys'] == "N") && ($cacheInstance->cache_file("refsys", true))) {
+       if (($_POST['cache_refsys'] == "N") && ($cacheInstance->cache_file("refsys"))) {
                $cacheInstance->cache_destroy();
        }
 
index dceeebda8a83cdd53375405d37069a1c9f2c29ad..b4cdc290059ac428cf71d17789ba449e7732dd9c 100644 (file)
@@ -106,7 +106,7 @@ if (isset($_POST['edit']))
        // Remove cache file if version matches
        if (GET_EXT_VERSION("cache") >= "0.1.2")
        {
-               if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy();
+               if ($cacheInstance->cache_file("mod_reg")) $cacheInstance->cache_destroy();
        }
 
        // Entries updated
index af0d44c4072be54e371cb76d52cea16c5f4157cf..44cafc4f7694a20cc8cf640b0c2817da6b52359a 100644 (file)
@@ -103,7 +103,7 @@ if (isset($_POST['ok'])) {
 
                // Update cache file
                if (GET_EXT_VERSION("cache") >= "0.1.2") {
-                       if ($cacheInstance->cache_file("refdepths", true)) $cacheInstance->cache_destroy();
+                       if ($cacheInstance->cache_file("refdepths")) $cacheInstance->cache_destroy();
                }
                break;
 
index 516143a4290d0f30210e7486eb26e2b85cc6a645..9c4c1c119b9290fd62e765e841822b21ea483d4b 100644 (file)
@@ -310,9 +310,9 @@ case "register": // Register new extension
                                // Do we need to update cache file?
                                if ((EXT_IS_ACTIVE("cache")) && ($cacheMode != "no")) {
                                        // Remove cache file (will be auto-created again!)
-                                       if ($cacheInstance->cache_file("config"    , true)) $cacheInstance->cache_destroy();
+                                       if ($cacheInstance->cache_file("config")) $cacheInstance->cache_destroy();
                                        if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
-                                       if ($cacheInstance->cache_file("mod_reg"   , true)) $cacheInstance->cache_destroy();
+                                       if ($cacheInstance->cache_file("mod_reg")) $cacheInstance->cache_destroy();
                                } // END - if
                        } elseif (GET_EXT_VERSION($ext_name) != "") {
                                // Motify the admin that we have a problem here...
index ef0072bff840a4949ee980158bf3be301cc21706..1e4856595c3ab9a5fdb71470c18166528982673b 100644 (file)
@@ -1732,7 +1732,7 @@ function IS_DEMO() {
        return ((EXT_IS_ACTIVE("demo")) && (get_session('admin_login') == "demo"));
 }
 //
-function LOAD_CONFIG($no="0") {
+function LOAD_CONFIG ($no="0") {
        global $cacheArray;
        $CFG_DUMMY = array();
 
index d6cfe7d5f560870f8d9e235c1edcc54634909d4e..b6f5972998dedbc5a97b395e4bd16aad29c29c31 100644 (file)
@@ -17,7 +17,7 @@
        </TR>
        <TR>
                <TD width="50%" align="right" class="install">{--MYSQL_HOST--}&nbsp;:&nbsp;</TD>
-               <TD width="50%"><INPUT type="text" name="mysql[host]" size="15"
+               <TD width="50%"><INPUT type="text" name="mysql[host]" size="25"
                        value="{!__MYSQL_HOST--}" class="install_normal"></TD>
        </TR>
        <TR>
@@ -25,7 +25,7 @@
        </TR>
        <TR>
                <TD width="50%" align="right" class="install">{--MYSQL_DBASE--}&nbsp;:&nbsp;</TD>
-               <TD width="50%"><INPUT type="text" name="mysql[dbase]" size="15"
+               <TD width="50%"><INPUT type="text" name="mysql[dbase]" size="25"
                        value="{!__MYSQL_DBASE--}" class="install_normal"></TD>
        </TR>
        <TR>
@@ -33,7 +33,7 @@
        </TR>
        <TR>
                <TD width="50%" align="right" class="install">{--MYSQL_PREFIX--}&nbsp;:&nbsp;</TD>
-               <TD width="50%"><INPUT type="text" name="mysql[prefix]" size="15"
+               <TD width="50%"><INPUT type="text" name="mysql[prefix]" size="25"
                        value="{!__MYSQL_PREFIX--}" class="install_normal"></TD>
        </TR>
        <TR>
@@ -41,7 +41,7 @@
        </TR>
        <TR>
                <TD width="50%" align="right" class="install">{--MYSQL_LOGIN--}&nbsp;:&nbsp;</TD>
-               <TD width="50%"><INPUT type="text" name="mysql[login]" size="10"
+               <TD width="50%"><INPUT type="text" name="mysql[login]" size="25"
                        value="{!__MYSQL_LOGIN--}" class="install_normal"></TD>
        </TR>
        <TR>
@@ -50,7 +50,7 @@
        <TR>
                <TD width="50%" align="right" class="install">{--MYSQL_PASS1--}&nbsp;:&nbsp;</TD>
                <TD width="50%"><INPUT type="password" name="mysql[pass1]"
-                       size="10" class="install_normal" class="install_normal"></TD>
+                       size="25" class="install_normal" class="install_normal"></TD>
        </TR>
        <TR>
                <TD colspan="2" height="10" class="seperator">&nbsp;</TD>
@@ -58,7 +58,7 @@
        <TR>
                <TD width="50%" align="right" class="install">{--MYSQL_PASS2--}&nbsp;:&nbsp;</TD>
                <TD width="50%"><INPUT type="password" name="mysql[pass2]"
-                       size="10" class="install_normal" class="install_normal"></TD>
+                       size="25" class="install_normal" class="install_normal"></TD>
        </TR>
        <TR>
                <TD colspan="2" height="21" class="seperator">&nbsp;</TD>
index b48b5da280fc3ae69470f7f654da5e7e76aebdaf..e7db28b4c454407a47056f5dd8eeec93020bb537 100644 (file)
@@ -17,7 +17,7 @@
        <TR>
                <TD width="50%" align="right" class="install">{--TEXT_SMTP_HOST--}&nbsp;:&nbsp;</TD>
                <TD width="50%">
-                 <INPUT type="text" name="smtp_host" size="15" value="{!__SMTP_HOST--}" class="install_normal">
+                 <INPUT type="text" name="smtp_host" size="25" value="{!__SMTP_HOST--}" class="install_normal">
                </TD>
        </TR>
        <TR>
@@ -26,7 +26,7 @@
        <TR>
                <TD width="50%" align="right" class="install">{--TEXT_SMTP_USER--}&nbsp;:&nbsp;</TD>
                <TD width="50%">
-                 <INPUT type="text" name="smtp_user" size="15" value="{!__SMTP_USER--}" class="install_normal">
+                 <INPUT type="text" name="smtp_user" size="25" value="{!__SMTP_USER--}" class="install_normal">
                </TD>
        </TR>
        <TR>
@@ -35,7 +35,7 @@
        <TR>
                <TD width="50%" align="right" class="install">{--TEXT_SMTP_PASS1--}&nbsp;:&nbsp;</TD>
                <TD width="50%">
-                 <INPUT type="password" name="smtp_pass1" size="15" value="{!__SMTP_PASS1--}" class="install_normal">
+                 <INPUT type="password" name="smtp_pass1" size="25" value="{!__SMTP_PASS1--}" class="install_normal">
                </TD>
        </TR>
        <TR>
@@ -44,7 +44,7 @@
        <TR>
                <TD width="50%" align="right" class="install">{--TEXT_SMTP_PASS2--}&nbsp;:&nbsp;</TD>
                <TD width="50%">
-                 <INPUT type="password" name="smtp_pass2" size="15" value="{!__SMTP_PASS2--}" class="install_normal">
+                 <INPUT type="password" name="smtp_pass2" size="25" value="{!__SMTP_PASS2--}" class="install_normal">
                </TD>
        </TR>
        <TR>