X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Floader%2Fload_cache-admin.php;h=f551ef47b7591c74e7b59193e56a1fa6505a87ab;hb=b68d7d9622a02f3ea9d44ae3c5dee672b097f956;hp=7e2a91bafffe1da15e7e067790ebb60ec7071b45;hpb=cca98f57dff720b174d21d071cee8303462485d7;p=mailer.git diff --git a/inc/loader/load_cache-admin.php b/inc/loader/load_cache-admin.php index 7e2a91baff..f551ef47b7 100644 --- a/inc/loader/load_cache-admin.php +++ b/inc/loader/load_cache-admin.php @@ -1,146 +1,3 @@ loadCacheFile("admins")) && ($cacheInstance->extensionVersionMatches("admins"))) { - // Load cache - global $cacheArray; - $cacheArray['admins'] = $cacheInstance->getArrayFromCache(); - - // Check if valid - if ((isset($cacheArray['admins']['login'])) && (is_array($cacheArray['admins']['login'])) && (is_array($cacheArray['admins']['aid']))) { - // Check count - if (count($cacheArray['admins']['login']) == count($cacheArray['admins']['aid'])) { - // Get "id map" - $idMap = $cacheArray['admins']['aid']; - - // Rewrite the cache array - for ($idx = (count($idMap) - 1); $idx >= 0; $idx--) { - // Rewrite all entries - foreach ($cacheArray['admins'] as $key=>$entryArray) { - // Rewrite the entry - if ($key == "aid") { - // Rewrite admin id (use login name as index) - $cacheArray['admins']['aid'][$cacheArray['admins']['login'][$idx]] = $entryArray[$idx]; - } else { - // Rewrite regular entry - $cacheArray['admins'][$key][$idMap[$idx]] = $entryArray[$idx]; - } - - // Is the last entry reached? - if ($idx == 0) { - // Remove it - unset($cacheArray['admins'][$key][0]); - } // END - if - } // END - if - } // END - for - } else { - // Nope, cache file is corrupted! - $cacheInstance->destroyCacheFile(); - unset($cacheArray['admins']); - } - } else { - // Nope, cache file is corrupted! - $cacheInstance->destroyCacheFile(); - unset($cacheArray['admins']); - } -} elseif ((getConfig('cache_admins') == "Y") && ($CSS != "1") && ($CSS != "-1")) { - // Create cache file - $cacheInstance->init("ADMINS"); - $cacheInstance->storeExtensionVersion("admins"); - - // Load every data from DB to cache file - $ADD = RUN_FILTER('sql_admin_extra_data'); - - // Query the database about this - $result_admins = SQL_QUERY("SELECT id AS aid, login, password, email".$ADD." -FROM `{!MYSQL_PREFIX!}_admins` -ORDER BY login", __FILE__, __LINE__); - while($dummy = SQL_FETCHARRAY($result_admins)) { - // Save row - $cacheInstance->addRow($dummy); - } // END - while - - // Free memory - SQL_FREERESULT($result_admins); - - // Close cache - $cacheInstance->finalize(); - - // Reload the cache - require(__FILE__); -} - -// Next cached table are the admins_acls... -if (GET_EXT_VERSION("admins") >= "0.3") { - // Check for cache file - if (($cacheInstance->loadCacheFile("admins_acls")) && ($cacheInstance->extensionVersionMatches("admins"))) { - // Load referal system from cache - global $cacheArray; - $cacheArray['admin_acls'] = $cacheInstance->getArrayFromCache(); - } elseif ((getConfig('cache_acls') == "Y") && ($CSS != "1") && ($CSS != "-1")) { - // Create cache file here - $cacheInstance->init("ADMINS_ACLS"); - $cacheInstance->storeExtensionVersion("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__); - - // Add all rows - while ($data = SQL_FETCHARRAY($result)) { - // Add row to cache file - $cacheInstance->addRow($data); - } // END - while - - // Free memory - SQL_FREERESULT($result); - - // Close cache - $cacheInstance->finalize(); - - // Reload the cache - require(__FILE__); - } -} // END - if - -// +// @DEPRECATED ?>