[ticket/13950] Hide undefined permissions

This hides the permissions of the disabled extensions

PHPBB3-13950
This commit is contained in:
Zoddo 2015-07-15 21:32:40 +02:00
parent bfbce5a1b0
commit 11b2bffa8e
2 changed files with 16 additions and 0 deletions

View file

@ -1139,6 +1139,11 @@ class auth_admin extends \phpbb\auth\auth
@reset($cat_array['permissions']); @reset($cat_array['permissions']);
while (list($permission, $allowed) = each($cat_array['permissions'])) while (list($permission, $allowed) = each($cat_array['permissions']))
{ {
if (!$phpbb_permissions->permission_defined($permission))
{
continue;
}
if ($s_view) if ($s_view)
{ {
$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array( $template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(

View file

@ -159,6 +159,17 @@ class permissions
return (isset($this->permissions[$permission]['cat'])) ? $this->permissions[$permission]['cat'] : 'misc'; return (isset($this->permissions[$permission]['cat'])) ? $this->permissions[$permission]['cat'] : 'misc';
} }
/**
* 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 * Returns the language string of a permission
* *