From 4b5d7f7cc9f9074a7752dc3b07a98f87f95a233a Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sun, 14 Jan 2007 21:00:40 +0000 Subject: [PATCH] (bug 8619) Add user-aware "unblock" link to Special:Blockip --- RELEASE-NOTES | 1 + includes/DefaultSettings.php | 2 +- includes/SpecialBlockip.php | 23 +++++++++++++++++++++++ languages/messages/MessagesEn.php | 2 ++ skins/common/common.css | 6 ++++++ skins/monobook/main.css | 7 +++++++ 6 files changed, 40 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c884b9588e..1c839c77c2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -67,6 +67,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Use browser default for printing size, don't force to 11pt * (bug 8632) Fix regression in page protection null edit update * (bug 7842) Link back to deleted revision list from deleted revision preview +* (bug 8619) Add user-aware "unblock" link to Special:Blockip == Languages updated == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6385353428..9ffc5fccd7 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1105,7 +1105,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '45'; +$wgStyleVersion = '46'; # Server-side caching: diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index b8512f688f..9619bb7f7d 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -170,6 +170,8 @@ class IPBlockForm { \n" ); + $wgOut->addHtml( $this->getUnblockLink() ); + $user = User::newFromName( $this->BlockAddress ); if( is_object( $user ) ) { $this->showLogFragment( $wgOut, $user->getUserPage() ); @@ -310,6 +312,27 @@ class IPBlockForm { return implode( ',', $flags ); } + /** + * Build a convenient link to unblock the given username or IP + * address, if available; otherwise link to a blank unblock + * form + * + * @return string + */ + private function getUnblockLink() { + global $wgUser; + $list = SpecialPage::getTitleFor( 'Ipblocklist' ); + $skin = $wgUser->getSkin(); + if( $this->BlockAddress ) { + $addr = htmlspecialchars( $this->BlockAddress ); + $link = $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock-addr', $addr ), + 'action=unblock&ip=' . $addr ); + } else { + $link = $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock' ), 'action=unblock' ); + } + return ''; + } + } ?> diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index ad090e6297..92a72f4a75 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1852,6 +1852,8 @@ pages that were vandalized).", 'blockipsuccesssub' => 'Block succeeded', 'blockipsuccesstext' => '[[{{ns:Special}}:Contributions/$1|$1]] has been blocked.
See [[{{ns:Special}}:Ipblocklist|IP block list]] to review blocks.', +'ipb-unblock-addr' => 'Unblock $1', +'ipb-unblock' => 'Unblock a username or IP address', 'unblockip' => 'Unblock user', 'unblockiptext' => 'Use the form below to restore write access to a previously blocked IP address or username.', diff --git a/skins/common/common.css b/skins/common/common.css index 0c3a258dd8..90576a0b38 100644 --- a/skins/common/common.css +++ b/skins/common/common.css @@ -462,6 +462,12 @@ table.multipageimage td { .templatesUsed { margin-top: 1em; } +/* "unblock" link on Special:Ipblocklist */ +p.mw-ipb-unblocklink { + font-size: 90%; + float: right; +} + /** * Here is some stuff that's ACTUALLY COMMON TO ALL SKINS. * When the day comes, it can be moved to a *real* common.css. diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 123ad1894d..ff5445ac1e 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -1611,6 +1611,13 @@ tr.sv-space td { display: none; } .mw-summary-preview { margin: 0.1em 0; } + +/* "unblock" link on Special:Ipblocklist */ +p.mw-ipb-unblocklink { + font-size: 90%; + float: right; +} + /** * Here is some stuff that's ACTUALLY COMMON TO ALL SKINS. * When the day comes, it can be moved to a *real* common.css. -- 2.20.1