From 0661a668e678e11dbd82d9086ff289d4989aace0 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sun, 22 Jan 2006 00:30:01 +0000 Subject: [PATCH] * Don't show a block link if the user doesn't exist/isn't a valid IP (e.g. MediaWiki default) * Link to block log --- RELEASE-NOTES | 2 +- includes/SpecialContributions.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e657ec5f09..a09da669f5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -329,7 +329,7 @@ Special Pages: * Move parentheses out of 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 diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 518fee6fbc..cf8095c99a 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -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 .= ')'; } -- 2.20.1