(bug 8619) Add user-aware "unblock" link to Special:Blockip
authorRob Church <robchurch@users.mediawiki.org>
Sun, 14 Jan 2007 21:00:40 +0000 (21:00 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sun, 14 Jan 2007 21:00:40 +0000 (21:00 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/SpecialBlockip.php
languages/messages/MessagesEn.php
skins/common/common.css
skins/monobook/main.css

index c884b95..1c839c7 100644 (file)
@@ -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 ==
 
index 6385353..9ffc5fc 100644 (file)
@@ -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:
index b8512f6..9619bb7 100644 (file)
@@ -170,6 +170,8 @@ class IPBlockForm {
        <input type='hidden' name='wpEditToken' value=\"{$token}\" />
 </form>\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 '<p class="mw-ipb-unblocklink">' . $link . '</p>';
+       }
+       
 }
 
 ?>
index ad090e6..92a72f4 100644 (file)
@@ -1852,6 +1852,8 @@ pages that were vandalized).",
 'blockipsuccesssub' => 'Block succeeded',
 'blockipsuccesstext' => '[[{{ns:Special}}:Contributions/$1|$1]] has been blocked.
 <br />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.',
index 0c3a258..90576a0 100644 (file)
@@ -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.
index 123ad18..ff5445a 100644 (file)
@@ -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.