mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
Merge remote-tracking branch 'github-exreaction/ticket/8323' into develop-ascraeus
* github-exreaction/ticket/8323: [ticket/8323] Cache auth request [ticket/8323] Combine into a single query [ticket/8323] Comments on phpbb_get_banned_user_ids input for test [ticket/8323] More readability in test case [ticket/8323] Comments [ticket/8323] dataProvider for the test; better test data [ticket/8323] Comments [ticket/8323] Unit test for phpbb_get_banned_user_ids [ticket/8323] Comments for inactive reasons in constants.php [ticket/8323] Only disable administrative deactivated accounts from receiving PMs [ticket/8323] Allow temporarily banned users to receive PMs, but not a notification [ticket/8323] Correct PM notification settings (only notify those who can receive them) [ticket/8323] Cleanup viewtopic code (not sure how this mess happened) [ticket/8323] Allow sending PMs to temporarily banned users [ticket/8323] Do not allow sending PMs to Inactive users [ticket/8323] Hide the Send PM link if users cannot receive the PM [ticket/8323] Correcting the comment [ticket/8323] Do not allow sending of Private Messages to users who are banned [ticket/8323] Remove code used for testing [ticket/8323] Do not allow sending of Private Messages to users who do not have permission to read private messages Conflicts: phpBB/language/en/ucp.php
This commit is contained in:
@@ -3455,9 +3455,12 @@ function remove_newly_registered($user_id, $user_data = false)
|
||||
*
|
||||
* @param array $user_ids Array of users' ids to check for banning,
|
||||
* leave empty to get complete list of banned ids
|
||||
* @param bool|int $ban_end Bool True to get users currently banned
|
||||
* Bool False to only get permanently banned users
|
||||
* Int Unix timestamp to get users banned until that time
|
||||
* @return array Array of banned users' ids if any, empty array otherwise
|
||||
*/
|
||||
function phpbb_get_banned_user_ids($user_ids = array())
|
||||
function phpbb_get_banned_user_ids($user_ids = array(), $ban_end = true)
|
||||
{
|
||||
global $db;
|
||||
|
||||
@@ -3469,9 +3472,26 @@ function phpbb_get_banned_user_ids($user_ids = array())
|
||||
$sql = 'SELECT ban_userid
|
||||
FROM ' . BANLIST_TABLE . "
|
||||
WHERE $sql_user_ids
|
||||
AND ban_exclude <> 1
|
||||
AND (ban_end > " . time() . '
|
||||
AND ban_exclude <> 1";
|
||||
|
||||
if ($ban_end === true)
|
||||
{
|
||||
// Banned currently
|
||||
$sql .= " AND (ban_end > " . time() . '
|
||||
OR ban_end = 0)';
|
||||
}
|
||||
else if ($ban_end === false)
|
||||
{
|
||||
// Permanently banned
|
||||
$sql .= " AND ban_end = 0";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Banned until a specified time
|
||||
$sql .= " AND (ban_end > " . (int) $ban_end . '
|
||||
OR ban_end = 0)';
|
||||
}
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
|
Reference in New Issue
Block a user