Fixes for admin ACLs
[mailer.git] / inc / libs / cache_functions.php
index d1cc8d28537b2d760adfe3e112f5e371cfd0af1a..afae515b3e16625c145946b9e7b1c266575102a1 100644 (file)
@@ -418,6 +418,9 @@ class CacheSystem {
 
 // Destroy the cache on extension changes
 function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
+       // Return the data anyway if there is no cache extension
+       if (!isCacheInstanceValid()) return $data;
+
        // Remove cache
        if ($GLOBALS['cache_instance']->loadCacheFile("config"))     $GLOBALS['cache_instance']->destroyCacheFile();
        if ($GLOBALS['cache_instance']->loadCacheFile("extensions")) $GLOBALS['cache_instance']->destroyCacheFile();
@@ -429,12 +432,18 @@ function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
 
 // Destroy the cache on changing admin
 function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE () {
+       // Skip this step if the cache instance is not there
+       if (!isCacheInstanceValid()) return false;
+
        // Remove cache
        if ($GLOBALS['cache_instance']->loadCacheFile("admins")) $GLOBALS['cache_instance']->destroyCacheFile();
 }
 
 // Destroy all cache files
 function FILTER_CACHE_DESTROY_ALL () {
+       // Skip this step if the cache instance is not there
+       if (!isCacheInstanceValid()) return false;
+
        // Remove cache files
        if ($GLOBALS['cache_instance']->loadCacheFile("admins"))      $GLOBALS['cache_instance']->destroyCacheFile();
        if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();