aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2012-03-12 01:44:00 +0800
committerrxu <rxu@mail.ru>2012-03-12 01:44:00 +0800
commit321d0d9b56011e049b245b6d54975b6c67b3b15b (patch)
tree75c015efc9d7464203ae398f48d013af56cb8053 /phpBB/includes/functions_user.php
parenta79b3490c2b21d283d7bc1f15c4923180e0f10b2 (diff)
downloadforums-321d0d9b56011e049b245b6d54975b6c67b3b15b.tar
forums-321d0d9b56011e049b245b6d54975b6c67b3b15b.tar.gz
forums-321d0d9b56011e049b245b6d54975b6c67b3b15b.tar.bz2
forums-321d0d9b56011e049b245b6d54975b6c67b3b15b.tar.xz
forums-321d0d9b56011e049b245b6d54975b6c67b3b15b.zip
[ticket/10684] Adjust pm_notifications() to handle stale bans
- Add parameter (array) to the function phpbb_get_banned_users_ids() - Fix function pm_notification() to handle users with stale bans PHPBB3-10684
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index dec8d09082..8f40401f0b 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -3588,22 +3588,26 @@ function remove_newly_registered($user_id, $user_data = false)
}
/**
-* Get a list of banned users' ids, ignoring stale bans which were not wiped yet.
+* Get a list of banned users' ids, ignoring stale bans which were not cleaned yet.
*
+* @param array $users_ids_array Array of users' ids to check for banning,
+* leave empty to get complete list of banned ids
* @return array Array of banned users' ids if any, empty array otherwise
*/
-function phpbb_get_banned_users_ids()
+function phpbb_get_banned_users_ids($users_ids_array = array())
{
global $db;
+ $sql_users_ids = (!empty($users_ids_array)) ? $db->sql_in_set('ban_userid', $users_ids_array) : 'ban_userid <> 0';
+
// Get banned User ID's
// Ignore stale bans which were not wiped yet
$banned_ids_list = array();
$sql = 'SELECT ban_userid
- FROM ' . BANLIST_TABLE . '
- WHERE ban_userid <> 0
+ FROM ' . BANLIST_TABLE . "
+ WHERE $sql_users_ids
AND ban_exclude <> 1
- AND (ban_end > ' . time() . '
+ AND (ban_end > " . time() . '
OR ban_end = 0)';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))