From 5b3d4ab76a6d3f1dec91c0e60b231488ac8c754c Mon Sep 17 00:00:00 2001 From: TK-999 Date: Tue, 8 Jul 2014 23:21:15 +0200 Subject: [PATCH] Make Special:Unblock link to contributions page for IP blockees Currently, Special:Unblock links to the user page of anon editors, which is inconsistent with other areas of the software, and also less useful, as IP userpages are often redlinks. This patch converts these links to Contributions links. Originally reported on Wikia, with an (incomplete) patch here: https://github.com/WikiaVolDev/app/compare/VOLDEV-31 Change-Id: I0fc73c7ee4fd7c81ed876717e8f60749c51685ae --- includes/specials/SpecialUnblock.php | 12 ++++++++++-- languages/i18n/en.json | 1 + languages/i18n/qqq.json | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/includes/specials/SpecialUnblock.php b/includes/specials/SpecialUnblock.php index 96e4dbfd01..244b88944a 100644 --- a/includes/specials/SpecialUnblock.php +++ b/includes/specials/SpecialUnblock.php @@ -63,8 +63,10 @@ class SpecialUnblock extends SpecialPage { if ( $form->show() ) { switch ( $this->type ) { - case Block::TYPE_USER: case Block::TYPE_IP: + $out->addWikiMsg( 'unblocked-ip', wfEscapeWikiText( $this->target ) ); + break; + case Block::TYPE_USER: $out->addWikiMsg( 'unblocked', wfEscapeWikiText( $this->target ) ); break; case Block::TYPE_RANGE: @@ -111,8 +113,14 @@ class SpecialUnblock extends SpecialPage { $fields['Target']['default'] = $target; $fields['Target']['type'] = 'hidden'; switch ( $type ) { - case Block::TYPE_USER: case Block::TYPE_IP: + $fields['Name']['default'] = Linker::linkKnown( + SpecialPage::getTitleFor( 'Contributions', $target->getName() ), + $target->getName() + ); + $fields['Name']['raw'] = true; + break; + case Block::TYPE_USER: $fields['Name']['default'] = Linker::link( $target->getUserPage(), $target->getName() diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 6fe2ee2308..574d9776da 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2083,6 +2083,7 @@ "unblocked": "[[User:$1|$1]] has been unblocked.", "unblocked-range": "$1 has been unblocked.", "unblocked-id": "Block $1 has been removed.", + "unblocked-ip": "[[Special:Contributions/$1|$1]] has been unblocked.", "blocklist": "Blocked users", "ipblocklist": "Blocked users", "ipblocklist-legend": "Find a blocked user", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 63bd617714..4d9ca6c1b6 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2242,9 +2242,10 @@ "unblockip": "Used as legend for the form in [[Special:Unblock]].", "unblockiptext": "Used in the {{msg-mw|Unblockip}} form on [[Special:Unblock]].", "ipusubmit": "Used as button text on [{{canonicalurl:Special:BlockList|action=unblock}} Special:BlockList?action=unblock]. To see the message:\n* Go to [[Special:BlockList]]\n* Click \"unblock\" for any block (but you can only see \"unblock\" if you have administrator rights)\n* It is now the button below the form", - "unblocked": "{{doc-important|Do not translate the namespace \"User:\".}}\nParameters:\n* $1 - the IP address or username that was unblocked\nSee also:\n* {{msg-mw|Unblocked-range}}\n* {{msg-mw|Unblocked-id}}", - "unblocked-range": "Shown when successfully lifting a rangeblock, so do not link to contributions. Parameters:\n* $1 - the range that was unblocked\nSee also:\n* {{msg-mw|Unblocked}}\n* {{msg-mw|Unblocked-id}}", + "unblocked": "{{doc-important|Do not translate the namespace \"User:\".}}\nParameters:\n* $1 - the username that was unblocked\nSee also:\n* {{msg-mw|Unblocked-range}}\n* {{msg-mw|Unblocked-id}}\n*{{msg-mw|Unblocked-ip}}", + "unblocked-range": "Shown when successfully lifting a rangeblock, so do not link to contributions. Parameters:\n* $1 - the range that was unblocked\nSee also:\n* {{msg-mw|Unblocked}}\n* {{msg-mw|Unblocked-id}}\n*{{msg-mw|Unblocked-ip}}", "unblocked-id": "Used in [[Special:Unblock]]. Parameters:\n* $1 - autoblock ID\nSee also:\n* {{msg-mw|Unblocked}}\n* {{msg-mw|Unblocked-range}}", + "unblocked-ip": "{{doc-important|Do not translate the title \"Special:Contributions\".}}\nParameters:\n* $1 - the IP address that was unblocked\nSee also:\n* {{msg-mw|Unblocked-range}}\n* {{msg-mw|Unblocked-id}}\n*{{msg-mw|Unblocked}}", "blocklist": "{{doc-special|BlockList}}", "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}}", -- 2.20.1