Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -208,6 +208,8 @@ |
209 | 209 | database connection and query errors. |
210 | 210 | * (bug 19646) New hook: ImgAuthBeforeStream for tests and functionality before file is streamed to user, but only when using img_auth |
211 | 211 | * Show change block / unblock link on Special:Contributions if user is blocked |
| 212 | +* Display note on Special:Contributions if the user is blocked, and provide an |
| 213 | + excerpt from the block log. |
212 | 214 | |
213 | 215 | === Bug fixes in 1.16 === |
214 | 216 | |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2839,6 +2839,7 @@ |
2840 | 2840 | 'sp-contributions-logs' => 'logs', |
2841 | 2841 | 'sp-contributions-talk' => 'talk', |
2842 | 2842 | 'sp-contributions-userrights' => 'user rights management', |
| 2843 | +'sp-contributions-blocked-notice'=> 'This user is currently blocked. The latest block log entry is provided below for reference:', |
2843 | 2844 | 'sp-contributions-search' => 'Search for contributions', |
2844 | 2845 | 'sp-contributions-username' => 'IP Address or username:', |
2845 | 2846 | 'sp-contributions-submit' => 'Search', |
Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -223,6 +223,7 @@ |
224 | 224 | wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) ); |
225 | 225 | |
226 | 226 | $links = $wgLang->pipeList( $tools ); |
| 227 | + $this->showBlock( $nt ); |
227 | 228 | } |
228 | 229 | |
229 | 230 | // Old message 'contribsub' had one parameter, but that doesn't work for |
— | — | @@ -237,6 +238,37 @@ |
238 | 239 | } |
239 | 240 | |
240 | 241 | /** |
| 242 | + * Show a note if the user is blocked and display the last block log entry. |
| 243 | + * @param Title $nt Title object for the target |
| 244 | + */ |
| 245 | + protected function showBlock( $nt ) { |
| 246 | + global $wgUser, $wgOut; |
| 247 | + $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut ); |
| 248 | + $pager = new LogPager( $loglist, 'block', false, $nt->getPrefixedText() ); |
| 249 | + // Check if there is something in the block log. |
| 250 | + // If this is not the case, either the user is not blocked, |
| 251 | + // or the account has been hidden via hideuser. |
| 252 | + if( $pager->getNumRows() > 0 ) { |
| 253 | + $pager->mLimit = 1; # Show only latest log entry. |
| 254 | + $wgOut->addHTML( '<div class="mw-warning-with-logexcerpt">' ); |
| 255 | + $wgOut->addWikiMsg( 'sp-contributions-blocked-notice' ); |
| 256 | + $wgOut->addHTML( |
| 257 | + $loglist->beginLogEventsList() . |
| 258 | + $pager->getBody() . |
| 259 | + $loglist->endLogEventsList() |
| 260 | + ); |
| 261 | + if( $pager->getNumRows() > $pager->mLimit ) { |
| 262 | + $wgOut->addHTML( $wgUser->getSkin()->link( |
| 263 | + SpecialPage::getTitleFor( 'Log', 'block' ), |
| 264 | + wfMsgHtml( 'log-fulllog' ), |
| 265 | + array(), |
| 266 | + array( 'page' => $nt->getPrefixedText() ) |
| 267 | + ) ); |
| 268 | + } |
| 269 | + $wgOut->addHTML( '</div>' ); |
| 270 | + } |
| 271 | + } |
| 272 | + /** |
241 | 273 | * Generates the namespace selector form with hidden attributes. |
242 | 274 | * @param $this->opts Array: the options to be included. |
243 | 275 | */ |