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
+* Display note on Special:Contributions if the user is blocked, and provide an
+ excerpt from the block log.
=== Bug fixes in 1.16 ===
wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) );
$links = $wgLang->pipeList( $tools );
+ $this->showBlock( $nt );
}
// Old message 'contribsub' had one parameter, but that doesn't work for
}
}
+ /**
+ * Show a note if the user is blocked and display the last block log entry.
+ * @param Title $nt Title object for the target
+ */
+ protected function showBlock( $nt ) {
+ global $wgUser, $wgOut;
+ $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut );
+ $pager = new LogPager( $loglist, 'block', false, $nt->getPrefixedText() );
+ // Check if there is something in the block log.
+ // If this is not the case, either the user is not blocked,
+ // or the account has been hidden via hideuser.
+ if( $pager->getNumRows() > 0 ) {
+ $pager->mLimit = 1; # Show only latest log entry.
+ $wgOut->addHTML( '<div class="mw-warning-with-logexcerpt">' );
+ $wgOut->addWikiMsg( 'sp-contributions-blocked-notice' );
+ $wgOut->addHTML(
+ $loglist->beginLogEventsList() .
+ $pager->getBody() .
+ $loglist->endLogEventsList()
+ );
+ if( $pager->getNumRows() > $pager->mLimit ) {
+ $wgOut->addHTML( $wgUser->getSkin()->link(
+ SpecialPage::getTitleFor( 'Log', 'block' ),
+ wfMsgHtml( 'log-fulllog' ),
+ array(),
+ array( 'page' => $nt->getPrefixedText() )
+ ) );
+ }
+ $wgOut->addHTML( '</div>' );
+ }
+ }
/**
* Generates the namespace selector form with hidden attributes.
* @param $this->opts Array: the options to be included.
'sp-contributions-logs' => 'logs',
'sp-contributions-talk' => 'talk',
'sp-contributions-userrights' => 'user rights management',
+'sp-contributions-blocked-notice'=> 'This user is currently blocked. The latest block log entry is provided below for reference:',
'sp-contributions-search' => 'Search for contributions',
'sp-contributions-username' => 'IP Address or username:',
'sp-contributions-submit' => 'Search',