diff options
Diffstat (limited to 'phpBB/includes/auth.php')
-rw-r--r-- | phpBB/includes/auth.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 70a3ccb046..a553d8e4ed 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -221,16 +221,18 @@ class auth */ function acl_getf_global($opt) { - $allowed = false; - if (is_array($opt)) { + // evaluates to true as soon as acl_getf_global is true for one option foreach ($opt as $check_option) { - $allowed |= $this->acl_getf_global($check_option); + if ($this->acl_getf_global($check_option)) + { + return true; + } } - return $allowed; + return false; } if (isset($this->acl_options['local'][$opt])) @@ -243,20 +245,19 @@ class auth continue; } - $allowed = (!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt]; - - if ($allowed) + // as soon as the user has any permission we're done so return true + if ((!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt]) { - break; + return true; } } } else if (isset($this->acl_options['global'][$opt])) { - $allowed = $this->acl_get($opt); + return $this->acl_get($opt); } - return $allowed; + return false; } /** |