phpBB

Code Changes

File: includes/acp/auth.php

  Unmodified   Added   Modified   Removed
Line 95Line 95
			}
else
{

			}
else
{

				$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', ($scope == 'global') ? 0 : false) : $this->$acl_user_function($user_id, $auth_option . '%', ($scope == 'global') ? 0 : false);

				$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%') : $this->$acl_user_function($user_id, $auth_option . '%', ($scope == 'global') ? 0 : false);

			}
}


			}
}


Line 488Line 488

if ($s_role_options)
{


if ($s_role_options)
{

						$s_role_options = '<option value="0"' . ((!$current_role_id) ? ' selected="selected"' : '') . ' title="' . htmlspecialchars($user->lang['NO_ROLE_ASSIGNED_EXPLAIN']) . '">' . $user->lang['NO_ROLE_ASSIGNED'] . '</option>' . $s_role_options;

						$s_role_options = '<option value="0"' . ((!$current_role_id) ? ' selected="selected"' : '') . ' title="' . htmlspecialchars($user->lang['NO_ROLE_ASSIGNED_EXPLAIN'], ENT_COMPAT) . '">' . $user->lang['NO_ROLE_ASSIGNED'] . '</option>' . $s_role_options;

					}

if (!$current_role_id && $mode != 'view')

					}

if (!$current_role_id && $mode != 'view')

Line 585Line 585

if ($s_role_options)
{


if ($s_role_options)
{

						$s_role_options = '<option value="0"' . ((!$current_role_id) ? ' selected="selected"' : '') . ' title="' . htmlspecialchars($user->lang['NO_ROLE_ASSIGNED_EXPLAIN']) . '">' . $user->lang['NO_ROLE_ASSIGNED'] . '</option>' . $s_role_options;

						$s_role_options = '<option value="0"' . ((!$current_role_id) ? ' selected="selected"' : '') . ' title="' . htmlspecialchars($user->lang['NO_ROLE_ASSIGNED_EXPLAIN'], ENT_COMPAT) . '">' . $user->lang['NO_ROLE_ASSIGNED'] . '</option>' . $s_role_options;

					}

if (!$current_role_id && $mode != 'view')

					}

if (!$current_role_id && $mode != 'view')

Line 1131Line 1131
	{
global $template, $phpbb_admin_path, $phpEx, $phpbb_container;


	{
global $template, $phpbb_admin_path, $phpEx, $phpbb_container;


		/* @var $phpbb_permissions \phpbb\permissions */

		/** @var \phpbb\permissions $phpbb_permissions */

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

 

$order = array_flip(array_keys($phpbb_permissions->get_permissions()));


foreach ($category_array as $cat => $cat_array)
{


foreach ($category_array as $cat => $cat_array)
{

Line 1149Line 1151
				'CAT_NAME'	=> $phpbb_permissions->get_category_lang($cat),
));


				'CAT_NAME'	=> $phpbb_permissions->get_category_lang($cat),
));


			/*	Sort permissions by name (more naturaly and user friendly than sorting by a primary key)
* Commented out due to it's memory consumption and time needed
*
$key_array = array_intersect(array_keys($user->lang), array_map(create_function('$a', 'return "acl_" . $a;'), array_keys($cat_array['permissions'])));
$values_array = $cat_array['permissions'];

			$permissions = array_filter($cat_array['permissions'], [$phpbb_permissions, 'permission_defined'], ARRAY_FILTER_USE_KEY);









			$cat_array['permissions'] = array();



			uksort($permissions, function($a, $b) use ($order) {
return $order[$a] <=> $order[$b];
});





			foreach ($key_array as $key)

			foreach ($permissions as $permission => $allowed)

			{

			{

				$key = str_replace('acl_', '', $key);
$cat_array['permissions'][$key] = $values_array[$key];
}
unset($key_array, $values_array);
*/
foreach ($cat_array['permissions'] as $permission => $allowed)
{
if (!$phpbb_permissions->permission_defined($permission))
{
continue;
}


 
				if ($s_view)
{
$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(

				if ($s_view)
{
$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(

Line 1218Line 1206
	{
global $phpbb_container;


	{
global $phpbb_container;


		/* @var $phpbb_permissions \phpbb\permissions */

		/** @var \phpbb\permissions $phpbb_permissions */

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

		$phpbb_permissions = $phpbb_container->get('acl.permissions');

 

$order = array_flip(array_keys($phpbb_permissions->get_permissions()));


foreach ($key_sort_array as $forum_id)
{


foreach ($key_sort_array as $forum_id)
{

Line 1228Line 1218
				continue;
}


				continue;
}


			$permissions = $permission_row[$forum_id];
ksort($permissions);




			$permissions = array_filter($permission_row[$forum_id], [$phpbb_permissions, 'permission_defined'], ARRAY_FILTER_USE_KEY);

uksort($permissions, function($a, $b) use ($order) {
return $order[$a] <=> $order[$b];
});


foreach ($permissions as $permission => $auth_setting)
{


foreach ($permissions as $permission => $auth_setting)
{