[ticket/9687] Remove support for ban exclude

PHPBB3-9687
This commit is contained in:
Marc Alexander 2023-07-29 16:41:43 +02:00
parent cf0e747d51
commit c88a9f0b01
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
8 changed files with 2 additions and 46 deletions

View file

@ -60,11 +60,6 @@
<dd><label for="banlength"><select name="banlength" id="banlength" onchange="if(this.value==-1){document.getElementById('banlengthother').style.display = 'block';}else{document.getElementById('banlengthother').style.display='none';}">{S_BAN_END_OPTIONS}</select></label></dd> <dd><label for="banlength"><select name="banlength" id="banlength" onchange="if(this.value==-1){document.getElementById('banlengthother').style.display = 'block';}else{document.getElementById('banlengthother').style.display='none';}">{S_BAN_END_OPTIONS}</select></label></dd>
<dd id="banlengthother" style="display: none;"><label><input type="text" name="banlengthother" class="inputbox" /><br /><span>{L_YEAR_MONTH_DAY}</span></label></dd> <dd id="banlengthother" style="display: none;"><label><input type="text" name="banlengthother" class="inputbox" /><br /><span>{L_YEAR_MONTH_DAY}</span></label></dd>
</dl> </dl>
<dl>
<dt><label for="banexclude">{L_BAN_EXCLUDE}{L_COLON}</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt>
<dd><label><input type="radio" name="banexclude" value="1" class="radio" /> {L_YES}</label>
<label><input type="radio" name="banexclude" id="banexclude" value="0" checked="checked" class="radio" /> {L_NO}</label></dd>
</dl>
<dl> <dl>
<dt><label for="banreason">{L_BAN_REASON}{L_COLON}</label></dt> <dt><label for="banreason">{L_BAN_REASON}{L_COLON}</label></dt>
<dd><input name="banreason" type="text" class="text medium" maxlength="255" id="banreason" /></dd> <dd><input name="banreason" type="text" class="text medium" maxlength="255" id="banreason" /></dd>

View file

@ -76,7 +76,6 @@ class acp_ban
* @var string ban Either string or array with usernames, ips or email addresses * @var string ban Either string or array with usernames, ips or email addresses
* @var int ban_length Ban length in minutes * @var int ban_length Ban length in minutes
* @var string ban_length_other Ban length as a date (YYYY-MM-DD) * @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_reason Ban reason displayed to moderators
* @var string ban_give_reason Ban reason displayed to the banned user * @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. * @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',
'ban_length', 'ban_length',
'ban_length_other', 'ban_length_other',
'ban_exclude',
'ban_reason', 'ban_reason',
'ban_give_reason', 'ban_give_reason',
'abort_ban', 'abort_ban',
@ -115,7 +113,6 @@ class acp_ban
* @var string ban Either string or array with usernames, ips or email addresses * @var string ban Either string or array with usernames, ips or email addresses
* @var int ban_length Ban length in minutes * @var int ban_length Ban length in minutes
* @var string ban_length_other Ban length as a date (YYYY-MM-DD) * @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_reason Ban reason displayed to moderators
* @var string ban_give_reason Ban reason displayed to the banned user * @var string ban_give_reason Ban reason displayed to the banned user
* @since 3.1.0-RC5 * @since 3.1.0-RC5
@ -125,7 +122,6 @@ class acp_ban
'ban', 'ban',
'ban_length', 'ban_length',
'ban_length_other', 'ban_length_other',
'ban_exclude',
'ban_reason', 'ban_reason',
'ban_give_reason', 'ban_give_reason',
); );
@ -150,7 +146,6 @@ class acp_ban
$this->page_title = $language->lang(strtoupper($mode) . '_BAN'); $this->page_title = $language->lang(strtoupper($mode) . '_BAN');
$l_ban_explain = $language->lang(strtoupper($mode) . '_BAN_EXPLAIN'); $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_title = $language->lang(strtoupper($mode) . '_UNBAN');
$l_unban_explain = $language->lang(strtoupper($mode) . '_UNBAN_EXPLAIN'); $l_unban_explain = $language->lang(strtoupper($mode) . '_UNBAN_EXPLAIN');
$l_no_ban_cell = $language->lang(strtoupper($mode) . '_NO_BANNED'); $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_TITLE' => $l_unban_title,
'L_UNBAN_EXPLAIN' => $l_unban_explain, 'L_UNBAN_EXPLAIN' => $l_unban_explain,
'L_BAN_CELL' => $l_ban_cell, 'L_BAN_CELL' => $l_ban_cell,
'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain,
'L_NO_BAN_CELL' => $l_no_ban_cell, 'L_NO_BAN_CELL' => $l_no_ban_cell,
'S_USERNAME_BAN' => $mode == 'user', 'S_USERNAME_BAN' => $mode == 'user',

View file

@ -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 mixed $ban Banned entity. Either string or array with usernames, ips or email addresses
* @param int $ban_len Ban length in minutes * @param int $ban_len Ban length in minutes
* @param string $ban_len_other Ban length as a date (YYYY-MM-DD) * @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_reason String describing the reason for this ban
* @param string $ban_give_reason * @param string $ban_give_reason
* @return boolean * @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; global $phpbb_container, $user;

View file

@ -68,7 +68,6 @@ class mcp_ban
$ban = $request->variable('ban', '', $mode === 'user'); $ban = $request->variable('ban', '', $mode === 'user');
$ban_length = $request->variable('banlength', 0); $ban_length = $request->variable('banlength', 0);
$ban_length_other = $request->variable('banlengthother', ''); $ban_length_other = $request->variable('banlengthother', '');
$ban_exclude = $request->variable('banexclude', 0);
$ban_reason = $request->variable('banreason', '', true); $ban_reason = $request->variable('banreason', '', true);
$ban_give_reason = $request->variable('bangivereason', '', 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 string ban Either string or array with usernames, ips or email addresses
* @var int ban_length Ban length in minutes * @var int ban_length Ban length in minutes
* @var string ban_length_other Ban length as a date (YYYY-MM-DD) * @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_reason Ban reason displayed to moderators
* @var string ban_give_reason Ban reason displayed to the banned user * @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. * @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',
'ban_length', 'ban_length',
'ban_length_other', 'ban_length_other',
'ban_exclude',
'ban_reason', 'ban_reason',
'ban_give_reason', 'ban_give_reason',
'abort_ban', 'abort_ban',
@ -108,7 +105,7 @@ class mcp_ban
{ {
trigger_error($abort_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 * 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 string ban Either string or array with usernames, ips or email addresses
* @var int ban_length Ban length in minutes * @var int ban_length Ban length in minutes
* @var string ban_length_other Ban length as a date (YYYY-MM-DD) * @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_reason Ban reason displayed to moderators
* @var string ban_give_reason Ban reason displayed to the banned user * @var string ban_give_reason Ban reason displayed to the banned user
* @since 3.1.0-RC5 * @since 3.1.0-RC5
@ -128,7 +124,6 @@ class mcp_ban
'ban', 'ban',
'ban_length', 'ban_length',
'ban_length_other', 'ban_length_other',
'ban_exclude',
'ban_reason', 'ban_reason',
'ban_give_reason', 'ban_give_reason',
); );
@ -144,7 +139,6 @@ class mcp_ban
'bansubmit' => true, 'bansubmit' => true,
'banlength' => $ban_length, 'banlength' => $ban_length,
'banlengthother' => $ban_length_other, 'banlengthother' => $ban_length_other,
'banexclude' => $ban_exclude,
'banreason' => $ban_reason, 'banreason' => $ban_reason,
'bangivereason' => $ban_give_reason, 'bangivereason' => $ban_give_reason,
); );
@ -189,7 +183,6 @@ class mcp_ban
$this->page_title = $user->lang[strtoupper($mode) . '_BAN']; $this->page_title = $user->lang[strtoupper($mode) . '_BAN'];
$l_ban_explain = $user->lang[strtoupper($mode) . '_BAN_EXPLAIN']; $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_title = $user->lang[strtoupper($mode) . '_UNBAN'];
$l_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN']; $l_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN'];
$l_no_ban_cell = $user->lang[strtoupper($mode) . '_NO_BANNED']; $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_TITLE' => $l_unban_title,
'L_UNBAN_EXPLAIN' => $l_unban_explain, 'L_UNBAN_EXPLAIN' => $l_unban_explain,
'L_BAN_CELL' => $l_ban_cell, 'L_BAN_CELL' => $l_ban_cell,
'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain,
'L_NO_BAN_CELL' => $l_no_ban_cell, 'L_NO_BAN_CELL' => $l_no_ban_cell,
'S_USERNAME_BAN' => ($mode == 'user') ? true : false, 'S_USERNAME_BAN' => ($mode == 'user') ? true : false,

View file

@ -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 <span style="text-decoration: underline;">Until -&gt;</span> for the ban length and enter a date in <kbd>YYYY-MM-DD</kbd> format.', '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 <span style="text-decoration: underline;">Until -&gt;</span> for the ban length and enter a date in <kbd>YYYY-MM-DD</kbd> format.',
'BAN_EXCLUDE' => 'Exclude from banning',
'BAN_LENGTH' => 'Length of ban', 'BAN_LENGTH' => 'Length of ban',
'BAN_REASON' => 'Reason for ban', 'BAN_REASON' => 'Reason for ban',
'BAN_GIVE_REASON' => 'Reason shown to the banned', '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)" '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' => '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. <samp>*@hotmail.com</samp>, <samp>*@*.domain.tld</samp>, etc.', '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. <samp>*@hotmail.com</samp>, <samp>*@*.domain.tld</samp>, etc.',
'EMAIL_NO_BANNED' => 'No banned email addresses', 'EMAIL_NO_BANNED' => 'No banned email addresses',
'EMAIL_UNBAN' => 'Un-ban or un-exclude emails', '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.', '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' => '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_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_HOSTNAME' => 'IP addresses or hostnames',
'IP_NO_BANNED' => 'No banned IP addresses', 'IP_NO_BANNED' => 'No banned IP addresses',
@ -76,7 +73,6 @@ $lang = array_merge($lang, array(
'UNTIL' => 'Until', 'UNTIL' => 'Until',
'USER_BAN' => 'Ban one or more users by username', '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 <span style="text-decoration: underline;">Find a member</span> facility to look up and add one or more users automatically.', 'USER_BAN_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the <span style="text-decoration: underline;">Find a member</span> facility to look up and add one or more users automatically.',
'USER_NO_BANNED' => 'No banned usernames', 'USER_NO_BANNED' => 'No banned usernames',
'USER_UNBAN' => 'Un-ban or un-exclude users by username', 'USER_UNBAN' => 'Un-ban or un-exclude users by username',

View file

@ -553,9 +553,6 @@ $lang = array_merge($lang, array(
'LOG_ATTACH_FILEUPLOAD' => '<strong>Orphan File uploaded to Post</strong><br />» ID %1$d - %2$s', 'LOG_ATTACH_FILEUPLOAD' => '<strong>Orphan File uploaded to Post</strong><br />» ID %1$d - %2$s',
'LOG_ATTACH_ORPHAN_DEL' => '<strong>Orphan Files deleted</strong><br />» %s', 'LOG_ATTACH_ORPHAN_DEL' => '<strong>Orphan Files deleted</strong><br />» %s',
'LOG_BAN_EXCLUDE_USER' => '<strong>Excluded user from ban</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_BAN_EXCLUDE_IP' => '<strong>Excluded IP from ban</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_BAN_EXCLUDE_EMAIL' => '<strong>Excluded email from ban</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_BAN_USER' => '<strong>Banned user</strong> for reason “<em>%1$s</em>”<br />» %2$s', 'LOG_BAN_USER' => '<strong>Banned user</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_BAN_IP' => '<strong>Banned IP</strong> for reason “<em>%1$s</em>”<br />» %2$s', 'LOG_BAN_IP' => '<strong>Banned IP</strong> for reason “<em>%1$s</em>”<br />» %2$s',
'LOG_BAN_EMAIL' => '<strong>Banned email</strong> for reason “<em>%1$s</em>”<br />» %2$s', 'LOG_BAN_EMAIL' => '<strong>Banned email</strong> for reason “<em>%1$s</em>”<br />» %2$s',

View file

@ -67,13 +67,6 @@
<hr /> <hr />
<dl>
<dt><label for="banexclude0">{L_BAN_EXCLUDE}{L_COLON}</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt>
<dd>
<label for="banexclude1"><input type="radio" name="banexclude" id="banexclude1" value="1" /> {L_YES}</label>
<label for="banexclude0"><input type="radio" name="banexclude" id="banexclude0" value="0" checked="checked" /> {L_NO}</label>
</dd>
</dl>
<!-- EVENT mcp_ban_fields_after --> <!-- EVENT mcp_ban_fields_after -->
</fieldset> </fieldset>

View file

@ -2,13 +2,7 @@
<dataset> <dataset>
<table name="phpbb_bans"> <table name="phpbb_bans">
<column>ban_userid</column> <column>ban_userid</column>
<column>ban_exclude</column>
<column>ban_end</column> <column>ban_end</column>
<row>
<value>1</value>
<value>1</value>
<value>0</value>
</row>
<row> <row>
<value>2</value> <value>2</value>
<value>0</value> <value>0</value>
@ -17,21 +11,17 @@
<row> <row>
<value>3</value> <value>3</value>
<value>0</value> <value>0</value>
<value>0</value>
</row> </row>
<row> <row>
<value>4</value> <value>4</value>
<value>0</value>
<value>2</value> <value>2</value>
</row> </row>
<row> <row>
<value>5</value> <value>5</value>
<value>0</value>
<value>999999999999999999999</value> <value>999999999999999999999</value>
</row> </row>
<row> <row>
<value>6</value> <value>6</value>
<value>0</value>
<value>3</value> <value>3</value>
</row> </row>
</table> </table>