- $lines = 0; $acl_mode = "failed";
- if (GET_EXT_VERSION("cache") >= "0.1.2") {
- // Load only from array when there are lines!
- if ((isset($cacheArray['admin_acls'])) && (is_array($cacheArray['admin_acls'])) && (count($cacheArray['admin_acls']) > 0)) {
- // Load ACL from array
- foreach ($cacheArray['admin_acls']['admin_id'] as $id => $aid_acls) {
- if ($aid == $aid_acls) {
- // Okay, one line was found!
- if ((!empty($act)) && ($cacheArray['admin_acls']['action_menu'][$id] == $act)) {
- // Main menu line found
- $acl_mode = $cacheArray['admin_acls']['access_mode'][$id];
- $lines = 1;
- }
- elseif ((!empty($wht)) && ($cacheArray['admin_acls']['what_menu'][$id] == $wht)) {
- // Check sub menu
- $acl_mode = $cacheArray['admin_acls']['access_mode'][$id];
- $lines = 1;
- }
- if ($lines == 1) {
- // Count cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
- break;
- }
- }
- }
-
- // No ACL found?
- if ($acl_mode == "failed") {
- $acl_mode = "";
- $lines = 0;
- }
- } else {
- // No lines here
- $lines = 0;
+ $acl_mode = "failed";
+ if ((GET_EXT_VERSION('cache') >= '0.1.2') && (count($GLOBALS['cache_array']['admin_acls']) > 0)) {
+ // Lookup in cache
+ if ((!empty($act)) && (isset($GLOBALS['cache_array']['admin_acls']['action_menu'][$aid])) & ($GLOBALS['cache_array']['admin_acls']['action_menu'][$aid] == $act)) {
+ // Main menu line found
+ $acl_mode = $GLOBALS['cache_array']['admin_acls']['access_mode'][$aid];
+
+ // Count cache hits
+ incrementConfigEntry('cache_hits');
+ } elseif ((!empty($wht)) && (isset($GLOBALS['cache_array']['admin_acls']['what_menu'][$aid])) && ($GLOBALS['cache_array']['admin_acls']['what_menu'][$aid] == $wht)) {
+ // Check sub menu
+ $acl_mode = $GLOBALS['cache_array']['admin_acls']['access_mode'][$aid];
+
+ // Count cache hits
+ incrementConfigEntry('cache_hits');