1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 03:54:10 +01:00

[ticket/10758] Dependency inject parameters into update_foes.

Also add phpbb prefix since the signature is being changed anyway.

PHPBB3-10758
This commit is contained in:
Oleg Pudeyev 2012-12-15 01:29:10 -05:00
parent 5c496674f6
commit e82833d4b8
3 changed files with 12 additions and 8 deletions

View File

@ -732,7 +732,7 @@ class acp_permissions
// Remove users who are now moderators or admins from everyones foes list
if ($permission_type == 'm_' || $permission_type == 'a_')
{
update_foes($group_id, $user_id);
phpbb_update_foes($db, $auth, $group_id, $user_id);
}
$this->log_action($mode, 'add', $permission_type, $ug_type, $ug_id, $forum_id);
@ -800,7 +800,7 @@ class acp_permissions
// Remove users who are now moderators or admins from everyones foes list
if ($permission_type == 'm_' || $permission_type == 'a_')
{
update_foes($group_id, $user_id);
phpbb_update_foes($db, $auth, $group_id, $user_id);
}
$this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids);

View File

@ -2744,12 +2744,16 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
}
/**
* Update foes - remove moderators and administrators from foe lists...
* Removes moderators and administrators from foe lists.
*
* @param phpbb_db_driver $db Database connection
* @param phpbb_auth $auth Authentication object
* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
* @return null
*/
function update_foes($group_id = false, $user_id = false)
function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false)
{
global $db, $auth;
// update foes for some user
if (is_array($user_id) && sizeof($user_id))
{

View File

@ -3730,12 +3730,12 @@ function group_update_listings($group_id)
if ($mod_permissions || $admin_permissions)
{
if (!function_exists('update_foes'))
if (!function_exists('phpbb_update_foes'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
update_foes(array($group_id));
phpbb_update_foes($db, $auth, array($group_id));
}
}