From: Tobias Date: Sun, 6 Sep 2009 22:53:04 +0000 (+0000) Subject: Show change block / unblock link on Special:Contributions if user is blocked X-Git-Tag: 1.31.0-rc.0~39891 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=904a73c5ce7099bb6ec44b3dc73adec7c6600296;p=lhc%2Fweb%2Fwiklou.git Show change block / unblock link on Special:Contributions if user is blocked --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c55f7afacf..69fe3a527d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -207,6 +207,7 @@ this. Was used when mwEmbed was going to be an extension. * Added $wgShowDBErrorBacktrace, to allow users to easily gather backtraces for database connection and query errors. * (bug 19646) New hook: ImgAuthBeforeStream for tests and functionality before file is streamed to user, but only when using img_auth +* Show change block / unblock link on Special:Contributions if user is blocked === Bug fixes in 1.16 === diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 4e9be9b9d2..f6f81d042d 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -161,12 +161,30 @@ class SpecialContributions extends SpecialPage { # Talk page link $tools[] = $sk->link( $talk, wfMsgHtml( 'sp-contributions-talk' ) ); if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) { - # Block link - if( $wgUser->isAllowed( 'block' ) ) - $tools[] = $sk->linkKnown( - SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), - wfMsgHtml( 'blocklink' ) - ); + if( $wgUser->isAllowed( 'block' ) ) { # Block / Change block / Unblock links + if ( $wgUser->isBlocked() ) { + $tools[] = $sk->linkKnown( # Change block link + SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), + wfMsgHtml( 'change-blocklink' ) + ); + $tools[] = $sk->linkKnown( # Unblock link + SpecialPage::getTitleFor( 'BlockList' ), + wfMsgHtml( 'unblocklink' ), + array(), + array( + 'action' => 'unblock', + 'ip' => $nt->getDBkey() + ), + array( 'known' ) + ); + } + else { # User is not blocked + $tools[] = $sk->linkKnown( # Block link + SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), + wfMsgHtml( 'blocklink' ) + ); + } + } # Block log link $tools[] = $sk->linkKnown( SpecialPage::getTitleFor( 'Log' ),