aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/auth.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2006-12-16 20:24:34 +0000
committerNils Adermann <naderman@naderman.de>2006-12-16 20:24:34 +0000
commit1e34820cd87837b545b310022ee460803d8c5b54 (patch)
tree8cb1026f115e8fe067d770b2bbc5fa4a42de1ce1 /phpBB/includes/auth.php
parent6938688e75e703208bd1087be8f37383da8e3f15 (diff)
downloadforums-1e34820cd87837b545b310022ee460803d8c5b54.tar
forums-1e34820cd87837b545b310022ee460803d8c5b54.tar.gz
forums-1e34820cd87837b545b310022ee460803d8c5b54.tar.bz2
forums-1e34820cd87837b545b310022ee460803d8c5b54.tar.xz
forums-1e34820cd87837b545b310022ee460803d8c5b54.zip
- Optimize acl_getf_global a bit
- a little performance improvement of the IP regular expressions - convert post_text/subject collation to utf8_unicode_ci if a user wants to use mysql_fulltext to allow case insensitivity [Bug #6272] - mysql_fulltext should alter all necessary columns at once to speed up the process - validate URLs against RFC3986 - fixed some weirdness in make_clickable I hope I didn't break any URLs with this commit, if I did then report it to the bugtracker please! git-svn-id: file:///svn/phpbb/trunk@6774 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/auth.php')
-rw-r--r--phpBB/includes/auth.php21
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;
}
/**