aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 9e198540af..1e688e8ab0 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -601,9 +601,14 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('LOWER(username)', $sql_usernames);
+ // Do not allow banning yourself
if (sizeof($founder))
{
- $sql .= ' AND ' . $db->sql_in_set('user_id', array_keys($founder), true);
+ $sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), array($user->data['user_id'])), true);
+ }
+ else
+ {
+ $sql .= ' AND user_id <> ' . $user->data['user_id'];
}
$result = $db->sql_query($sql);