Security line in all includes changed
[mailer.git] / inc / loader / load_cache-admin.php
index 06689b6b81d735f4a2998063e4cb16406f526e84..9210709caa2b5394c7efcb0d2ce86767ce5445ef 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 } // END - if
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 } // END - if
@@ -123,6 +123,9 @@ ORDER BY login", __FILE__, __LINE__);
        // Free memory
        SQL_FREERESULT($result_admins);
 
        // Free memory
        SQL_FREERESULT($result_admins);
 
+       // Close cache
+       $cacheInstance->cache_close();
+
        // Reload the cache
        require(__FILE__);
 }
        // Reload the cache
        require(__FILE__);
 }
@@ -137,33 +140,15 @@ if (GET_EXT_VERSION("admins") >= "0.3") {
                // Load referral system from cache
                global $cacheArray;
                $cacheArray['admin_acls'] = $cacheInstance->cache_load();
                // Load referral system from cache
                global $cacheArray;
                $cacheArray['admin_acls'] = $cacheInstance->cache_load();
-
-               // Valid cache file
-               $CNT = 0;
-               foreach ($cacheArray['admin_acls'] as $k => $array) {
-                       $CNT += count($array);
-               } // END - foreach
-
-               // When there is a period (.) in the result this test will fail and so the cache file is
-               // damaged/corrupted
-               if (count($cacheArray['admin_acls']) > 0) {
-                       $TEST = "failed";
-                       if (count($cacheArray['admin_acls']) > 0 ) $TEST = ($CNT / (count($cacheArray['admin_acls'])));
-                       if ($TEST != bigintval($TEST)) {
-                               // Cache file is corrupted!
-                               $cacheInstance->cache_destroy();
-                               unset($cacheArray['admin_acls']);
-                       } // END - if
-               } // END - if
        } elseif (($_CONFIG['cache_acls'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
                // Create cache file here
                $cacheInstance->cache_init("ADMINS_ACLS");
 
                // 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__);
        } elseif (($_CONFIG['cache_acls'] == "Y") && ($CSS != "1") && ($CSS != "-1")) {
                // Create cache file here
                $cacheInstance->cache_init("ADMINS_ACLS");
 
                // 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__);
-               while ($DATA = SQL_FETCHARRAY($result)) {
+               while ($data = SQL_FETCHARRAY($result)) {
                        // Add row to cache file
                        // Add row to cache file
-                       $cacheInstance->add_row($DATA);
+                       $cacheInstance->add_row($data);
                } // END - while
 
                // Free memory
                } // END - while
 
                // Free memory