aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorZoddo <zoddo.ino@gmail.com>2015-07-15 21:32:40 +0200
committerZoddo <zoddo.ino@gmail.com>2015-08-28 18:43:59 +0200
commit11b2bffa8e41a37b778019d0aee4041f72f8c0a0 (patch)
tree5d9c308dffca3b0925f1160ce5950041157e815c /phpBB
parentbfbce5a1b0b2e22ea2027d82d87c8bc32917a5b2 (diff)
downloadforums-11b2bffa8e41a37b778019d0aee4041f72f8c0a0.tar
forums-11b2bffa8e41a37b778019d0aee4041f72f8c0a0.tar.gz
forums-11b2bffa8e41a37b778019d0aee4041f72f8c0a0.tar.bz2
forums-11b2bffa8e41a37b778019d0aee4041f72f8c0a0.tar.xz
forums-11b2bffa8e41a37b778019d0aee4041f72f8c0a0.zip
[ticket/13950] Hide undefined permissions
This hides the permissions of the disabled extensions PHPBB3-13950
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/acp/auth.php5
-rw-r--r--phpBB/phpbb/permissions.php11
2 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 905e981cdc..6c13a6694c 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -1139,6 +1139,11 @@ class auth_admin extends \phpbb\auth\auth
@reset($cat_array['permissions']);
while (list($permission, $allowed) = each($cat_array['permissions']))
{
+ if (!$phpbb_permissions->permission_defined($permission))
+ {
+ continue;
+ }
+
if ($s_view)
{
$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(
diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php
index 82f59b5c20..7006c84b76 100644
--- a/phpBB/phpbb/permissions.php
+++ b/phpBB/phpbb/permissions.php
@@ -160,6 +160,17 @@ class permissions
}
/**
+ * Checks if a permission has been defined
+ *
+ * @param string $permission Identifier of the permission
+ * @return bool True if the permission is defined, false otherwise
+ */
+ public function permission_defined($permission)
+ {
+ return isset($this->permissions[$permission]);
+ }
+
+ /**
* Returns the language string of a permission
*
* @param string $permission Identifier of the permission