X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Floader%2Fload_cache-admin.php;h=9210709caa2b5394c7efcb0d2ce86767ce5445ef;hp=06689b6b81d735f4a2998063e4cb16406f526e84;hb=963e55ca1ea79e255f235e359cde9f7862191dc5;hpb=89edd713e330fd16e8da1edeadfd5046296ff0d2 diff --git a/inc/loader/load_cache-admin.php b/inc/loader/load_cache-admin.php index 06689b6b81..9210709caa 100644 --- a/inc/loader/load_cache-admin.php +++ b/inc/loader/load_cache-admin.php @@ -32,7 +32,7 @@ ************************************************************************/ // 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 @@ -123,6 +123,9 @@ ORDER BY login", __FILE__, __LINE__); // Free memory SQL_FREERESULT($result_admins); + // Close cache + $cacheInstance->cache_close(); + // 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(); - - // 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__); - while ($DATA = SQL_FETCHARRAY($result)) { + while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file - $cacheInstance->add_row($DATA); + $cacheInstance->add_row($data); } // END - while // Free memory