aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_admin.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-12-25 15:18:47 +0100
committerAndreas Fischer <bantu@phpbb.com>2012-12-25 15:18:47 +0100
commitcb7f6deb07ba2869c62a80584d81feb3d3baf682 (patch)
treef30e45ace777ecc2a1b1db2ec2ab8449bc7486ac /phpBB/includes/functions_admin.php
parent21b9ac6c880cbee7c8bda263871b24414671672a (diff)
parent8707a3413504b0cf922086daa6fc497ccf090448 (diff)
downloadforums-cb7f6deb07ba2869c62a80584d81feb3d3baf682.tar
forums-cb7f6deb07ba2869c62a80584d81feb3d3baf682.tar.gz
forums-cb7f6deb07ba2869c62a80584d81feb3d3baf682.tar.bz2
forums-cb7f6deb07ba2869c62a80584d81feb3d3baf682.tar.xz
forums-cb7f6deb07ba2869c62a80584d81feb3d3baf682.zip
Merge remote-tracking branch 'p/ticket/10758' into develop
* p/ticket/10758: [ticket/10758] Add return to the other compat function. [ticket/10758] Add periods. [ticket/10758] Yes, only one empty line. [ticket/10758] Add deprecated tags. [ticket/10758] Add compat functions. [ticket/10758] Admin is not working yet. [ticket/10758] Test moderator and admin permissions. [ticket/10758] Check that acl was changed in the test. [ticket/10758] Extract obtain_user_data for the benefit of tests. [ticket/10758] Functional test for changing a user's permission. [ticket/10758] Spelling fix. [ticket/10758] Add a test for acp login. [ticket/10758] Dependency inject parameters into update_foes. [ticket/10758] Dependency inject parameters into cache_moderators.
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r--phpBB/includes/functions_admin.php54
1 files changed, 45 insertions, 9 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 15930f9a2c..5529f2af46 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);
@@ -2469,6 +2473,20 @@ function cache_moderators()
}
/**
+* Cache moderators. Called whenever permissions are changed
+* 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()
+{
+ 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.
*/
@@ -2740,12 +2758,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))
{
@@ -2855,6 +2877,20 @@ function update_foes($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
+*/
+function update_foes($group_id = false, $user_id = false)
+{
+ global $db, $auth;
+ return phpbb_update_foes($db, $auth, $group_id, $user_id);
+}
+
+/**
* Lists inactive users
*/
function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $limit_days = 0, $sort_by = 'user_inactive_time DESC')