diff options
| -rw-r--r-- | phpBB/includes/acp/auth.php | 10 | ||||
| -rw-r--r-- | phpBB/phpbb/permissions.php | 22 | 
2 files changed, 32 insertions, 0 deletions
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 2c4c82fcc7..027be03a00 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -1114,6 +1114,11 @@ class auth_admin extends \phpbb\auth\auth  		@reset($category_array);  		while (list($cat, $cat_array) = each($category_array))  		{ +			if (!$phpbb_permissions->category_defined($cat)) +			{ +				continue; +			} +  			$template->assign_block_vars($tpl_cat, array(  				'S_YES'		=> ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,  				'S_NEVER'	=> ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false, @@ -1140,6 +1145,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 c462f72a73..0c6fad295c 100644 --- a/phpBB/phpbb/permissions.php +++ b/phpBB/phpbb/permissions.php @@ -160,6 +160,28 @@ class permissions  	}  	/** +	* Checks if a category has been defined +	* +	* @param	string	$category	Identifier of the category +	* @return	bool	True if the category is defined, false otherwise +	*/ +	public function category_defined($category) +	{ +		return isset($this->categories[$category]); +	} + +	/** +	* 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  | 
