diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-19 21:30:32 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-19 21:30:32 +0000 |
commit | 52045ff2631cdfa14efd3379b64843cafd00df8f (patch) | |
tree | c703bdc88138b7a95a3240c329b0e9e5040e53c6 /phpBB/includes/functions_user.php | |
parent | cbfcf07af37e86dec6d6b8bdc1891b9524bd77ec (diff) | |
download | forums-52045ff2631cdfa14efd3379b64843cafd00df8f.tar forums-52045ff2631cdfa14efd3379b64843cafd00df8f.tar.gz forums-52045ff2631cdfa14efd3379b64843cafd00df8f.tar.bz2 forums-52045ff2631cdfa14efd3379b64843cafd00df8f.tar.xz forums-52045ff2631cdfa14efd3379b64843cafd00df8f.zip |
some bugfixes
git-svn-id: file:///svn/phpbb/trunk@6104 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index c246e98396..0eab7d8a6f 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -472,6 +472,23 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas $ban_end = 0; } + $founder = array(); + + if (!$ban_exclude) + { + // Create a list of founder... + $sql = 'SELECT user_id, user_email + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_FOUNDER; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $founder[$row['user_id']] = $row['user_email']; + } + $db->sql_freeresult($result); + } + $banlist_ary = array(); switch ($mode) @@ -502,6 +519,12 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' WHERE username IN (' . $sql_usernames . ')'; + + if (sizeof($founder)) + { + $sql .= ' AND user_id NOT IN (' . implode(', ', array_keys($founder)) . ')'; + } + $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) @@ -618,9 +641,14 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas foreach ($ban_list as $ban_item) { - if (preg_match('#^.*?@*|(([a-z0-9\-]+\.)+([a-z]{2,3}))$#i', trim($ban_item))) + $ban_item = trim($ban_item); + + if (preg_match('#^.*?@*|(([a-z0-9\-]+\.)+([a-z]{2,3}))$#i', $ban_item)) { - $banlist_ary[] = trim($ban_item); + if (!sizeof($founder) || !in_array($ban_item, $founder)) + { + $banlist_ary[] = $ban_item; + } } } @@ -764,6 +792,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas // Update log $log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_'; add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log); + return true; } |