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 (($_CONFIG['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 = ", id, id"; if (GET_EXT_VERSION("admins") >= "0.3") $ADD = ", default_acl AS def_acl"; if (GET_EXT_VERSION("admins") >= "0.6.7") $ADD .= ", la_mode"; if (GET_EXT_VERSION("admins") >= "0.7.0") $ADD .= ", login_failtures, UNIX_TIMESTAMP(last_failture) AS last_failture"; // 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 (($_CONFIG['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 // ?>