Special:BlockList: Option to hide autoblocks

Add a new option to Special:BlockList for hiding autoblocks.

Bug: T270623
Change-Id: I7a00a08974b9f8ed8655b516c3b4a19da524d8a1
This commit is contained in:
Tobi406 2020-12-21 19:08:32 +01:00
parent 3503537452
commit 503a2669ae
No known key found for this signature in database
GPG key ID: DEFCE76446027C50
3 changed files with 7 additions and 0 deletions

View file

@ -122,6 +122,7 @@ class SpecialBlockList extends SpecialPage {
'options-messages' => [
'blocklist-tempblocks' => 'tempblocks',
'blocklist-indefblocks' => 'indefblocks',
'blocklist-autoblocks' => 'autoblocks',
'blocklist-userblocks' => 'userblocks',
'blocklist-addressblocks' => 'addressblocks',
'blocklist-rangeblocks' => 'rangeblocks',
@ -210,6 +211,10 @@ class SpecialBlockList extends SpecialPage {
if ( in_array( 'userblocks', $this->options ) ) {
$conds['ipb_user'] = 0;
}
if ( in_array( 'autoblocks', $this->options ) ) {
// ipb_parent_block_id = 0 because of T282890
$conds[] = "ipb_parent_block_id IS NULL OR ipb_parent_block_id = 0";
}
if ( in_array( 'addressblocks', $this->options ) ) {
$conds[] = "ipb_user != 0 OR ipb_range_end > ipb_range_start";
}

View file

@ -2762,6 +2762,7 @@
"autoblocklist-otherblocks": "Other {{PLURAL:$1|autoblock|autoblocks}}",
"ipblocklist": "Blocked users",
"ipblocklist-legend": "Find a blocked user",
"blocklist-autoblocks": "Hide autoblocks",
"blocklist-userblocks": "Hide account blocks",
"blocklist-tempblocks": "Hide temporary blocks",
"blocklist-indefblocks": "Hide indefinite blocks",

View file

@ -2982,6 +2982,7 @@
"autoblocklist-otherblocks": "[[File:Special AutoBlockList new.png|thumb|Example]]\nUsed on [[Special:AutoblockList]] as header for other blocks, i.e. from GlobalBlocking or TorBlocks.\n\nParameters:\n* $1 - number of blocks",
"ipblocklist": "Title of [[Special:Ipblocklist]].",
"ipblocklist-legend": "Used as legend of the form in [[Special:BlockList]].\n\nSee also:\n* {{msg-mw|Ipblocklist-legend}}\n* {{msg-mw|Ipblocklist-submit}}",
"blocklist-autoblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]]. \n{{Related|Blocklist-blocks}}",
"blocklist-userblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]].\n{{Related|Blocklist-blocks}}",
"blocklist-tempblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]].\n{{Related|Blocklist-blocks}}",
"blocklist-indefblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]].\n{{Related|Blocklist-blocks}}",