From: Rob Church Date: Sun, 22 Jan 2006 00:30:01 +0000 (+0000) Subject: * Don't show a block link if the user doesn't exist/isn't a valid IP (e.g. MediaWiki... X-Git-Tag: 1.6.0~455 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=0661a668e678e11dbd82d9086ff289d4989aace0;p=lhc%2Fweb%2Fwiklou.git * 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 --- 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 .= ')'; }