aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-03-23 11:43:54 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-03-23 11:43:54 +0100
commite35aecb9bd051b46a804366cf461d426dc062404 (patch)
tree368f0e9b4870ba7e41dac2c21d304e64f595d03e /phpBB/includes/functions_user.php
parentbaefbdb8825a37051a200203a0191d34caa12229 (diff)
parentcc13bac412442a1d72affcc3222b6bfca094e92a (diff)
downloadforums-e35aecb9bd051b46a804366cf461d426dc062404.tar
forums-e35aecb9bd051b46a804366cf461d426dc062404.tar.gz
forums-e35aecb9bd051b46a804366cf461d426dc062404.tar.bz2
forums-e35aecb9bd051b46a804366cf461d426dc062404.tar.xz
forums-e35aecb9bd051b46a804366cf461d426dc062404.zip
Merge remote-tracking branch 'upstream/develop' into feature/event-dispatcher
* upstream/develop: (30 commits) [task/travis] Refactor php version check for dbunit install [task/travis] Exclude functional and slow tests [ticket/10719] Revert "Skip functional tests on PHP 5.2" [task/travis-develop2] Update version from 5.3 to 5.3.2 [task/travis] Dropping support for 5.2 in develop branch [task/travis] Some more small travis fixes [task/travis] Rename travis phpunit config files [task/travis] Fixing some travis issues [ticket/10684] Adjust function and parameter name, minor changes. [task/travis] Add automated testing to readme [task/travis] Removing development information [task/travis] Adding Travis Continuous Intergration Support [ticket/10704] minor typo in a comment [ticket/10717] Fix profile field sample in prosilver“s memberlist_view.html [ticket/10691] Fixed the speed of creating search index [task/php54-ascraeus] Bring p_master#module_auth into PHP 5 era. [task/php54] Disable E_STRICT in Olympus when running on PHP 5.4. [task/php54] Refactor error_reporting call slightly. [ticket/10690] Fix undefined UNAPPROVED_POSTS_ZERO_TOTAL in queue [ticket/10689] Fix "First character"-option in "Find a member"-search ...
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 509e1a953c..18452c27e9 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -3691,3 +3691,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;
+}