aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/ucp.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-02-11 21:09:47 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-02-11 21:09:47 +0000
commitde43ceac369fca2e35c8dbf7e2315e6aaf7e48d3 (patch)
treea640e8f68bb412d00b725a4b2b87775bab9ed18c /phpBB/ucp.php
parent496e4203852c6ffd76f3ad07bfdd258abba52f40 (diff)
downloadforums-de43ceac369fca2e35c8dbf7e2315e6aaf7e48d3.tar
forums-de43ceac369fca2e35c8dbf7e2315e6aaf7e48d3.tar.gz
forums-de43ceac369fca2e35c8dbf7e2315e6aaf7e48d3.tar.bz2
forums-de43ceac369fca2e35c8dbf7e2315e6aaf7e48d3.tar.xz
forums-de43ceac369fca2e35c8dbf7e2315e6aaf7e48d3.zip
use logical expression for module permissions + prefixes for acl's and config variables (acl_ and cfg_).
git-svn-id: file:///svn/phpbb/trunk@4829 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/ucp.php')
-rwxr-xr-xphpBB/ucp.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index bac1c5d51c..ddd595ce99 100755
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -50,7 +50,7 @@ class module
// Private methods, should not be overwritten
function create($module_type, $module_url, $selected_mod = false, $selected_submod = false)
{
- global $template, $auth, $db, $user;
+ global $template, $auth, $db, $user, $config;
$sql = 'SELECT module_id, module_title, module_filename, module_subs, module_acl
FROM ' . MODULES_TABLE . "
@@ -64,15 +64,9 @@ class module
// Authorisation is required for the basic module
if ($row['module_acl'])
{
- $is_auth = FALSE;
- foreach (explode(',', $row['module_acl']) as $auth_option)
- {
- if ($auth->acl_get($auth_option))
- {
- $is_auth = TRUE;
- break;
- }
- }
+ $is_auth = false;
+
+ eval('$is_auth = (' . preg_replace(array('#acl_([a-z_]+)#e', '#cfg_([a-z_]+)#e'), array('$auth->acl_get("\\1")', '$config["\\1"]'), $row['module_acl']) . ');');
// The user is not authorised to use this module, skip it
if (!$is_auth)