mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
move around - better not call create_function in a loop
git-svn-id: file:///svn/phpbb/trunk@5469 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
4d4eab9c32
commit
247a7a8182
1 changed files with 7 additions and 1 deletions
|
@ -616,6 +616,7 @@ class auth_admin extends auth
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Global Moderator Permission Mask
|
||||||
case 'mod_global':
|
case 'mod_global':
|
||||||
|
|
||||||
if ($group_id === false && $user_id === false)
|
if ($group_id === false && $user_id === false)
|
||||||
|
@ -630,6 +631,7 @@ class auth_admin extends auth
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Moderator Permission Mask
|
||||||
case 'mod_local':
|
case 'mod_local':
|
||||||
|
|
||||||
if ($forum_id === false && ($group_id === false || $user_id === false))
|
if ($forum_id === false && ($group_id === false || $user_id === false))
|
||||||
|
@ -676,6 +678,9 @@ class auth_admin extends auth
|
||||||
$compare_options = array_combine($compare_options, array_fill(1, sizeof($compare_options), 0));
|
$compare_options = array_combine($compare_options, array_fill(1, sizeof($compare_options), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Defining the user-function here to save some memory
|
||||||
|
$return_zero = create_function('$value', 'return 0;');
|
||||||
|
|
||||||
// Actually fill the gaps
|
// Actually fill the gaps
|
||||||
if (sizeof($hold_ary))
|
if (sizeof($hold_ary))
|
||||||
{
|
{
|
||||||
|
@ -688,7 +693,7 @@ class auth_admin extends auth
|
||||||
// The differences get merged into $hold_ary (all permissions having ACL_NO set)
|
// The differences get merged into $hold_ary (all permissions having ACL_NO set)
|
||||||
$hold_ary[$ug_id][$id] = array_merge($options,
|
$hold_ary[$ug_id][$id] = array_merge($options,
|
||||||
|
|
||||||
array_map(create_function('$value', 'return 0;'),
|
array_map($return_zero,
|
||||||
array_flip(
|
array_flip(
|
||||||
array_diff(
|
array_diff(
|
||||||
array_keys($compare_options), array_keys($options)
|
array_keys($compare_options), array_keys($options)
|
||||||
|
@ -813,6 +818,7 @@ class auth_admin extends auth
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Add table
Reference in a new issue