mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/16430] Filter the correct permissions array
PHPBB3-16430
This commit is contained in:
parent
6326b6b631
commit
a2a199b48e
1 changed files with 9 additions and 9 deletions
|
@ -1136,10 +1136,13 @@ class auth_admin extends \phpbb\auth\auth
|
||||||
|
|
||||||
$order = array_flip(array_keys($phpbb_permissions->get_permissions()));
|
$order = array_flip(array_keys($phpbb_permissions->get_permissions()));
|
||||||
|
|
||||||
$category_array = array_filter($category_array, [$phpbb_permissions, 'permission_defined'], ARRAY_FILTER_USE_KEY);
|
|
||||||
|
|
||||||
foreach ($category_array as $cat => $cat_array)
|
foreach ($category_array as $cat => $cat_array)
|
||||||
{
|
{
|
||||||
|
if (!$phpbb_permissions->category_defined($cat))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$template->assign_block_vars($tpl_cat, array(
|
$template->assign_block_vars($tpl_cat, array(
|
||||||
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
|
'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,
|
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
|
||||||
|
@ -1148,17 +1151,14 @@ class auth_admin extends \phpbb\auth\auth
|
||||||
'CAT_NAME' => $phpbb_permissions->get_category_lang($cat),
|
'CAT_NAME' => $phpbb_permissions->get_category_lang($cat),
|
||||||
));
|
));
|
||||||
|
|
||||||
uksort($cat_array['permissions'], function($a, $b) use ($order) {
|
$permissions = array_filter($cat_array['permissions'], [$phpbb_permissions, 'permission_defined'], ARRAY_FILTER_USE_KEY);
|
||||||
|
|
||||||
|
uksort($permissions, function($a, $b) use ($order) {
|
||||||
return $order[$a] <=> $order[$b];
|
return $order[$a] <=> $order[$b];
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach ($cat_array['permissions'] as $permission => $allowed)
|
foreach ($permissions as $permission => $allowed)
|
||||||
{
|
{
|
||||||
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(
|
||||||
|
|
Loading…
Add table
Reference in a new issue