mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-29 04:50:51 +02:00
Merge branch 'develop' into feature/avatars
* develop: (335 commits) [ticket/10575] Adding public visibility to the methods. [ticket/10575] Fixing non-static access to static functions get_instance [ticket/10547] User is not logged in as admin after installation [ticket/10650] Revert merge of 'rahulr92/ticket/10650' into develop [ticket/10650] Added checking for empty subjects [ticket/10650] Corrected intendation [ticket/10650]Added permission checking and utf8 functions [ticket/10650] Cropped subject and inserted newline [ticket/10650] Corrected space before true [ticket/10650] Changed language files and forumlist [ticket/10650] Added static sql files [ticket/10650] Displaying last topic on forum list [ticket/10760] Fix numbering in php fun facts. [ticket/10760] Value must be quoted as it might be two words. [ticket/10760] PHP is great. This commit is the proof. [ticket/10760] Catch both versions of parse error output in php. [ticket/10607] Added 'Powered by' translation string. [ticket/10760] Account for display_errors=stderr in pre-commit hook. [ticket/10760] Quote PHP_BIN when using it. [ticket/10760] Use echo -e only if echo understands -e. ...
This commit is contained in:
@@ -3692,3 +3692,36 @@ function remove_newly_registered($user_id, $user_data = false)
|
||||
|
||||
return $user_data['group_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets user ids of currently banned registered users.
|
||||
*
|
||||
* @param array $user_ids 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_user_ids($user_ids = array())
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql_user_ids = (!empty($user_ids)) ? $db->sql_in_set('ban_userid', $user_ids) : '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 $sql_user_ids
|
||||
AND ban_exclude <> 1
|
||||
AND (ban_end > " . time() . '
|
||||
OR ban_end = 0)';
|
||||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$user_id = (int) $row['ban_userid'];
|
||||
$banned_ids_list[$user_id] = $user_id;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
return $banned_ids_list;
|
||||
}
|
||||
|
Reference in New Issue
Block a user