From c88a9f0b01aa7071d0516c4e38d35bf64df36b75 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 29 Jul 2023 16:41:43 +0200 Subject: [PATCH] [ticket/9687] Remove support for ban exclude PHPBB3-9687 --- phpBB/adm/style/acp_ban.html | 5 ----- phpBB/includes/acp/acp_ban.php | 6 ------ phpBB/includes/functions_user.php | 3 +-- phpBB/includes/mcp/mcp_ban.php | 10 +--------- phpBB/language/en/acp/ban.php | 4 ---- phpBB/language/en/acp/common.php | 3 --- phpBB/styles/prosilver/template/mcp_ban.html | 7 ------- tests/functions/fixtures/banned_users.xml | 10 ---------- 8 files changed, 2 insertions(+), 46 deletions(-) diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html index ffea40027e..35e2028618 100644 --- a/phpBB/adm/style/acp_ban.html +++ b/phpBB/adm/style/acp_ban.html @@ -60,11 +60,6 @@
-
-

{L_BAN_EXCLUDE_EXPLAIN}
-
-
-
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 5d459444d0..b41f42fd6a 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -76,7 +76,6 @@ class acp_ban * @var string ban Either string or array with usernames, ips or email addresses * @var int ban_length Ban length in minutes * @var string ban_length_other Ban length as a date (YYYY-MM-DD) - * @var bool ban_exclude Are we banning or excluding from another ban * @var string ban_reason Ban reason displayed to moderators * @var string ban_give_reason Ban reason displayed to the banned user * @var mixed abort_ban Either false, or an error message that is displayed to the user. @@ -88,7 +87,6 @@ class acp_ban 'ban', 'ban_length', 'ban_length_other', - 'ban_exclude', 'ban_reason', 'ban_give_reason', 'abort_ban', @@ -115,7 +113,6 @@ class acp_ban * @var string ban Either string or array with usernames, ips or email addresses * @var int ban_length Ban length in minutes * @var string ban_length_other Ban length as a date (YYYY-MM-DD) - * @var bool ban_exclude Are we banning or excluding from another ban * @var string ban_reason Ban reason displayed to moderators * @var string ban_give_reason Ban reason displayed to the banned user * @since 3.1.0-RC5 @@ -125,7 +122,6 @@ class acp_ban 'ban', 'ban_length', 'ban_length_other', - 'ban_exclude', 'ban_reason', 'ban_give_reason', ); @@ -150,7 +146,6 @@ class acp_ban $this->page_title = $language->lang(strtoupper($mode) . '_BAN'); $l_ban_explain = $language->lang(strtoupper($mode) . '_BAN_EXPLAIN'); - $l_ban_exclude_explain = $language->lang(strtoupper($mode) . '_BAN_EXCLUDE_EXPLAIN'); $l_unban_title = $language->lang(strtoupper($mode) . '_UNBAN'); $l_unban_explain = $language->lang(strtoupper($mode) . '_UNBAN_EXPLAIN'); $l_no_ban_cell = $language->lang(strtoupper($mode) . '_NO_BANNED'); @@ -182,7 +177,6 @@ class acp_ban 'L_UNBAN_TITLE' => $l_unban_title, 'L_UNBAN_EXPLAIN' => $l_unban_explain, 'L_BAN_CELL' => $l_ban_cell, - 'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain, 'L_NO_BAN_CELL' => $l_no_ban_cell, 'S_USERNAME_BAN' => $mode == 'user', diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index d11f7cbfeb..3913b20090 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -921,12 +921,11 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL) * @param mixed $ban Banned entity. Either string or array with usernames, ips or email addresses * @param int $ban_len Ban length in minutes * @param string $ban_len_other Ban length as a date (YYYY-MM-DD) -* @param boolean $ban_exclude Exclude these entities from banning? * @param string $ban_reason String describing the reason for this ban * @param string $ban_give_reason * @return boolean */ -function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason = '') +function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_reason, $ban_give_reason = '') { global $phpbb_container, $user; diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index c358680e00..2398d76371 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -68,7 +68,6 @@ class mcp_ban $ban = $request->variable('ban', '', $mode === 'user'); $ban_length = $request->variable('banlength', 0); $ban_length_other = $request->variable('banlengthother', ''); - $ban_exclude = $request->variable('banexclude', 0); $ban_reason = $request->variable('banreason', '', true); $ban_give_reason = $request->variable('bangivereason', '', true); @@ -85,7 +84,6 @@ class mcp_ban * @var string ban Either string or array with usernames, ips or email addresses * @var int ban_length Ban length in minutes * @var string ban_length_other Ban length as a date (YYYY-MM-DD) - * @var bool ban_exclude Are we banning or excluding from another ban * @var string ban_reason Ban reason displayed to moderators * @var string ban_give_reason Ban reason displayed to the banned user * @var mixed abort_ban Either false, or an error message that is displayed to the user. @@ -97,7 +95,6 @@ class mcp_ban 'ban', 'ban_length', 'ban_length_other', - 'ban_exclude', 'ban_reason', 'ban_give_reason', 'abort_ban', @@ -108,7 +105,7 @@ class mcp_ban { trigger_error($abort_ban); } - user_ban($mode, $ban, $ban_length, $ban_length_other, $ban_exclude, $ban_reason, $ban_give_reason); + user_ban($mode, $ban, $ban_length, $ban_length_other, $ban_reason, $ban_give_reason); /** * Use this event to perform actions after the ban has been performed @@ -118,7 +115,6 @@ class mcp_ban * @var string ban Either string or array with usernames, ips or email addresses * @var int ban_length Ban length in minutes * @var string ban_length_other Ban length as a date (YYYY-MM-DD) - * @var bool ban_exclude Are we banning or excluding from another ban * @var string ban_reason Ban reason displayed to moderators * @var string ban_give_reason Ban reason displayed to the banned user * @since 3.1.0-RC5 @@ -128,7 +124,6 @@ class mcp_ban 'ban', 'ban_length', 'ban_length_other', - 'ban_exclude', 'ban_reason', 'ban_give_reason', ); @@ -144,7 +139,6 @@ class mcp_ban 'bansubmit' => true, 'banlength' => $ban_length, 'banlengthother' => $ban_length_other, - 'banexclude' => $ban_exclude, 'banreason' => $ban_reason, 'bangivereason' => $ban_give_reason, ); @@ -189,7 +183,6 @@ class mcp_ban $this->page_title = $user->lang[strtoupper($mode) . '_BAN']; $l_ban_explain = $user->lang[strtoupper($mode) . '_BAN_EXPLAIN']; - $l_ban_exclude_explain = $user->lang[strtoupper($mode) . '_BAN_EXCLUDE_EXPLAIN']; $l_unban_title = $user->lang[strtoupper($mode) . '_UNBAN']; $l_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN']; $l_no_ban_cell = $user->lang[strtoupper($mode) . '_NO_BANNED']; @@ -218,7 +211,6 @@ class mcp_ban 'L_UNBAN_TITLE' => $l_unban_title, 'L_UNBAN_EXPLAIN' => $l_unban_explain, 'L_BAN_CELL' => $l_ban_cell, - 'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain, 'L_NO_BAN_CELL' => $l_no_ban_cell, 'S_USERNAME_BAN' => ($mode == 'user') ? true : false, diff --git a/phpBB/language/en/acp/ban.php b/phpBB/language/en/acp/ban.php index 93d5cf9a8b..ad73553649 100644 --- a/phpBB/language/en/acp/ban.php +++ b/phpBB/language/en/acp/ban.php @@ -44,7 +44,6 @@ $lang = array_merge($lang, array( 'ACP_BAN_EXPLAIN' => 'Here you can control the banning of users by name, IP or email address. These methods prevent a user reaching any part of the board. You can give a short (maximum 3000 characters) reason for the ban if you wish. This will be displayed in the admin log. The duration of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select Until -> for the ban length and enter a date in YYYY-MM-DD format.', - 'BAN_EXCLUDE' => 'Exclude from banning', 'BAN_LENGTH' => 'Length of ban', 'BAN_REASON' => 'Reason for ban', 'BAN_GIVE_REASON' => 'Reason shown to the banned', @@ -53,14 +52,12 @@ $lang = array_merge($lang, array( 'BANNED_UNTIL_DURATION' => '%1$s (until %2$s)', // Example: "7 days (until Tue 14.Jul.2009, 14:44)" 'EMAIL_BAN' => 'Ban one or more email addresses', - 'EMAIL_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered email address from all current bans.', 'EMAIL_BAN_EXPLAIN' => 'To specify more than one email address enter each on a new line. To match partial addresses use * as the wildcard, e.g. *@hotmail.com, *@*.domain.tld, etc.', 'EMAIL_NO_BANNED' => 'No banned email addresses', 'EMAIL_UNBAN' => 'Un-ban or un-exclude emails', 'EMAIL_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple email addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded email addresses are emphasised.', 'IP_BAN' => 'Ban one or more IPs', - 'IP_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered IP from all current bans.', 'IP_BAN_EXPLAIN' => 'To specify several different IPs or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use “*”.', 'IP_HOSTNAME' => 'IP addresses or hostnames', 'IP_NO_BANNED' => 'No banned IP addresses', @@ -76,7 +73,6 @@ $lang = array_merge($lang, array( 'UNTIL' => 'Until', 'USER_BAN' => 'Ban one or more users by username', - 'USER_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered users from all current bans.', 'USER_BAN_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the Find a member facility to look up and add one or more users automatically.', 'USER_NO_BANNED' => 'No banned usernames', 'USER_UNBAN' => 'Un-ban or un-exclude users by username', diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index e53937c8a3..aeab0af262 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -553,9 +553,6 @@ $lang = array_merge($lang, array( 'LOG_ATTACH_FILEUPLOAD' => 'Orphan File uploaded to Post
» ID %1$d - %2$s', 'LOG_ATTACH_ORPHAN_DEL' => 'Orphan Files deleted
» %s', - 'LOG_BAN_EXCLUDE_USER' => 'Excluded user from ban for reason “%1$s
» %2$s', - 'LOG_BAN_EXCLUDE_IP' => 'Excluded IP from ban for reason “%1$s
» %2$s', - 'LOG_BAN_EXCLUDE_EMAIL' => 'Excluded email from ban for reason “%1$s
» %2$s', 'LOG_BAN_USER' => 'Banned user for reason “%1$s
» %2$s', 'LOG_BAN_IP' => 'Banned IP for reason “%1$s
» %2$s', 'LOG_BAN_EMAIL' => 'Banned email for reason “%1$s
» %2$s', diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html index ed85e294c2..379c992921 100644 --- a/phpBB/styles/prosilver/template/mcp_ban.html +++ b/phpBB/styles/prosilver/template/mcp_ban.html @@ -67,13 +67,6 @@
-
-

{L_BAN_EXCLUDE_EXPLAIN}
-
- - -
-
diff --git a/tests/functions/fixtures/banned_users.xml b/tests/functions/fixtures/banned_users.xml index 4be21c3201..4d6a6bfa40 100644 --- a/tests/functions/fixtures/banned_users.xml +++ b/tests/functions/fixtures/banned_users.xml @@ -2,13 +2,7 @@ ban_userid - ban_excludeban_end - - 1 - 1 - 0 - 2 0 @@ -17,21 +11,17 @@ 3 0 - 0 4 - 0 2 5 - 0 999999999999999999999 6 - 0 3