r80845 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80844‎ | r80845 | r80846 >
Date:08:00, 24 January 2011
Author:brion
Status:ok
Tags:
Comment:
ContactPage extension fixes:
* Swapped bad isAllowed('sendemail') check for isBlockedFromEmailuser(): r71929, r74175
* Swapped bogus partial duplicate of OutputPage::blockedPage() for calling it directly, fixes missing fields in block message: follow-up to r71882
Modified paths:
  • /trunk/extensions/ContactPage/SpecialContact.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContactPage/SpecialContact.php
@@ -50,23 +50,10 @@
5151 return;
5252 }
5353
54 - // Blocked users cannot use the contact form.
55 - if ( !$wgUser->isAllowed( 'sendemail' ) ) {
56 - $wgOut->setPageTitle( wfMsg( 'blockedtitle' ) );
57 - $wgOut->setRobotPolicy( 'noindex,nofollow' );
58 - $wgOut->setArticleRelated( false );
 54+ // Blocked users cannot use the contact form if they're disabled from sending email.
 55+ if ( $wgUser->isBlockedFromEmailuser() ) {
 56+ $wgOut->blockedPage();
5957
60 - $ip = wfGetIP();
61 - $blocker = User::whoIs( $wgUser->mBlock->mBy );
62 - $blockReason = $wgUser->mBlock->mReason;
63 -
64 - if ( strval( $blockReason ) === '' ) {
65 - $blockReason = wfMsg( 'blockednoreason' );
66 - }
67 -
68 - $wgOut->addWikiMsg( 'blockedtext', $ip, $blockReason, $blocker );
69 - $wgOut->returnToMain( false );
70 -
7158 return;
7259 }
7360

Follow-up revisions

RevisionCommit summaryAuthorDate
r808971.17: MFT r80697, r80755, r80767, r80771, r80773, r80774, r80779, r80816, r80...catrope18:57, 24 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71882(bug 24391) Prevent use of Special:ContactPage for blocked users....siebrand12:31, 29 August 2010
r71929Only deny use of contact form if sending e-mail is blocked instead of blockin...siebrand06:57, 30 August 2010
r74175Follow-up r71882 and r71929: Fix bug in r71929. Check should be reversed.siebrand23:13, 2 October 2010

Status & tagging log