Anonymity/privacy extension 'removeip' added
[mailer.git] / inc / extensions.php
index 64e4c486993fe001850a65d2f25707c8557f0437..0b75f56d259428dd8b3a5e2562a2f051db948bea 100644 (file)
@@ -301,18 +301,6 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
 
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):mode={$EXT_LOAD_MODE}<br />\n";
 
-               // Remove cache file(s) if extension is active
-               if (((EXT_IS_ACTIVE("cache")) || (GET_EXT_VERSION("cache") != "")) && (((SQL_AFFECTEDROWS() == 1) && ($EXT_LOAD_MODE == "remove")) || ($sqlRan === true))) {
-                       //* 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();
-
-                       // @TODO This causes the whole (!) menu cache being purged
-                       CACHE_PURGE_ADMIN_MENU();
-               } // END - if
-
                // Is this the sql_patches?
                //* DEBUG: */ echo __LINE__.": {$id}/{$ext_name}/{$EXT_LOAD_MODE}<br />\n";
                if (($ext_name == "sql_patches") && (($EXT_LOAD_MODE == "register") || ($EXT_LOAD_MODE == "remove"))) {
@@ -321,6 +309,18 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
                        LOAD_URL("modules.php?module=admin&logout=1&".$EXT_LOAD_MODE."=sql_patches");
                } // END - if
        } // END - if
+
+       // Remove cache file(s) if extension is active
+       if (((EXT_IS_ACTIVE("cache")) || (GET_EXT_VERSION("cache") != "")) && (((SQL_AFFECTEDROWS() == 1)) || ($sqlRan === true) || ($EXT_LOAD_MODE == "activate") || ($EXT_LOAD_MODE == "deactivate"))) {
+               //* 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();
+
+               // @TODO This causes the whole (!) menu cache being purged
+               CACHE_PURGE_ADMIN_MENU();
+       } // END - if
 }
 // Check if given extension is active
 function EXT_IS_ACTIVE ($ext_name) {
@@ -349,11 +349,16 @@ function EXT_IS_ACTIVE ($ext_name) {
                        // Extension was not found!
                        return false;
                }
+
+               // Load entry
                list($active) = SQL_FETCHROW($result);
-               //* DEBUG: */ echo $ext_name."[DB]: {$active}<br />\n";
+
+               // Free result
                SQL_FREERESULT($result);
 
+
                // Write cache array
+               //* DEBUG: */ echo $ext_name."[DB]: {$active}<br />\n";
                $cacheArray['extensions']['ext_active'][$ext_name] = $active;
        } else {
                // Extension not active!