From 5c496674f63b31e892d0f3bed7921feb947ed839 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 15 Dec 2012 01:19:55 -0500 Subject: [ticket/10758] Dependency inject parameters into cache_moderators. Also add phpbb prefix since the signature is being changed anyway. PHPBB3-10758 --- phpBB/includes/functions_admin.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 15930f9a2c..571f1acd1d 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2292,13 +2292,17 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr } /** -* Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username -* and group names must be carried through for the moderators table +* Cache moderators. Called whenever permissions are changed +* via admin_permissions. Changes of usernames and group names +* must be carried through for the moderators table +* +* @param phpbb_db_driver $db Database connection +* @param phpbb_cache_driver_interface Cache driver +* @param phpbb_auth $auth Authentication object +* @return null */ -function cache_moderators() +function phpbb_cache_moderators($db, $cache, $auth) { - global $db, $cache, $auth, $phpbb_root_path, $phpEx; - // Remove cached sql results $cache->destroy('sql', MODERATOR_CACHE_TABLE); -- cgit v1.2.1 From e82833d4b8bc9241641577b12a779e12338ace39 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 15 Dec 2012 01:29:10 -0500 Subject: [ticket/10758] Dependency inject parameters into update_foes. Also add phpbb prefix since the signature is being changed anyway. PHPBB3-10758 --- phpBB/includes/functions_admin.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 571f1acd1d..e8dd55813b 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -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)) { -- cgit v1.2.1 From 69e373c1af09e10722c1146f44493e8dc3669918 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Wed, 19 Dec 2012 21:47:53 -0500 Subject: [ticket/10758] Add compat functions. PHPBB3-10758 --- phpBB/includes/functions_admin.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index e8dd55813b..496d3eba09 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2472,6 +2472,20 @@ function phpbb_cache_moderators($db, $cache, $auth) $db->sql_multi_insert(MODERATOR_CACHE_TABLE, $sql_ary); } +/** +* Cache moderators. Called whenever permissions are changed +* via admin_permissions. Changes of usernames and group names +* must be carried through for the moderators table +* +* @return null +*/ +function cache_moderators() +{ + global $db, $cache, $auth; + return phpbb_cache_moderators($db, $cache, $auth); +} + + /** * View log * If $log_count is set to false, we will skip counting all entries in the database. @@ -2862,6 +2876,19 @@ function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false) unset($perms); } +/** +* Removes moderators and administrators from foe lists. +* +* @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) +{ + global $db, $auth; + phpbb_update_foes($db, $auth, $group_id, $user_id); +} + /** * Lists inactive users */ -- cgit v1.2.1 From 5c817289834e7a34d47410f89907de1bafefff8a Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 20 Dec 2012 05:10:57 -0500 Subject: [ticket/10758] Add deprecated tags. PHPBB3-10758 --- phpBB/includes/functions_admin.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 496d3eba09..77c70eb6fc 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2477,6 +2477,7 @@ function phpbb_cache_moderators($db, $cache, $auth) * via admin_permissions. Changes of usernames and group names * must be carried through for the moderators table * +* @deprecated 3.1 * @return null */ function cache_moderators() @@ -2879,6 +2880,7 @@ function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false) /** * Removes moderators and administrators from foe lists. * +* @deprecated 3.1 * @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 -- cgit v1.2.1 From aaaf8a5332aa6679522c687f0c8144d0819c05a5 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 22 Dec 2012 17:40:25 -0500 Subject: [ticket/10758] Yes, only one empty line. PHPBB3-10758 --- phpBB/includes/functions_admin.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 77c70eb6fc..22735cf2cd 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2486,7 +2486,6 @@ function cache_moderators() return phpbb_cache_moderators($db, $cache, $auth); } - /** * View log * If $log_count is set to false, we will skip counting all entries in the database. -- cgit v1.2.1 From 496529fa714b6cdc6e8b8ffeb7750fe27907c267 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 22 Dec 2012 17:54:54 -0500 Subject: [ticket/10758] Add periods. PHPBB3-10758 --- phpBB/includes/functions_admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 22735cf2cd..3864c9de36 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2294,7 +2294,7 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr /** * Cache moderators. Called whenever permissions are changed * via admin_permissions. Changes of usernames and group names -* must be carried through for the moderators table +* must be carried through for the moderators table. * * @param phpbb_db_driver $db Database connection * @param phpbb_cache_driver_interface Cache driver @@ -2475,7 +2475,7 @@ function phpbb_cache_moderators($db, $cache, $auth) /** * Cache moderators. Called whenever permissions are changed * via admin_permissions. Changes of usernames and group names -* must be carried through for the moderators table +* must be carried through for the moderators table. * * @deprecated 3.1 * @return null -- cgit v1.2.1 From 8707a3413504b0cf922086daa6fc497ccf090448 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Mon, 24 Dec 2012 15:12:57 -0500 Subject: [ticket/10758] Add return to the other compat function. PHPBB3-10758 --- phpBB/includes/functions_admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 3864c9de36..5529f2af46 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2887,7 +2887,7 @@ function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false) function update_foes($group_id = false, $user_id = false) { global $db, $auth; - phpbb_update_foes($db, $auth, $group_id, $user_id); + return phpbb_update_foes($db, $auth, $group_id, $user_id); } /** -- cgit v1.2.1