* Don't show a block link if the user doesn't exist/isn't a valid IP (e.g. MediaWiki...
authorRob Church <robchurch@users.mediawiki.org>
Sun, 22 Jan 2006 00:30:01 +0000 (00:30 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sun, 22 Jan 2006 00:30:01 +0000 (00:30 +0000)
* Link to block log

RELEASE-NOTES
includes/SpecialContributions.php

index e657ec5..a09da66 100644 (file)
@@ -329,7 +329,7 @@ Special Pages:
 * Move parentheses out of <a> link in Special:Contributions
 * (bug 3192): properly check 'limit' parameter on Special:Contributions
 * (bug 3187) watchlist text refer to unexistent "Stop watching" action
-* Add block link to Special:Contributions
+* Add block link and a link to the block log to Special:Contributions
 
 Misc.:
 * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect
index 518fee6..cf8095c 100644 (file)
@@ -225,8 +225,11 @@ function wfSpecialContributions( $par = null ) {
        $talk = $nt->getTalkPage();
        if( $talk ) {
                $ul .= ' (' . $sk->makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) );
-               if( $wgUser->isAllowed( 'block' ) ) {
-                       $ul .= ' | ' . $sk->makeLinkObj( Title::makeTitle( NS_SPECIAL, 'Blockip/' . $nt->getText() ), wfMsgHtml( 'blocklink' ) );
+               if( ( $id != 0 ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) {
+                       if( $wgUser->isAllowed( 'block' ) ) {
+                               $ul .= ' | ' . $sk->makeLinkObj( Title::makeTitle( NS_SPECIAL, 'Blockip/' . $nt->getText() ), wfMsgHtml( 'blocklink' ) );
+                       }
+                       $ul .= ' | ' . $sk->makeLinkObj( Title::makeTitle( NS_SPECIAL, 'Log' ), LogPage::logName( 'block' ), 'type=block&page=' . $nt->getPrefixedText() );
                }
                $ul .= ')';
        }