r34846 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34845‎ | r34846 | r34847 >
Date:03:49, 15 May 2008
Author:ktchan
Status:old
Tags:
Comment:
Fix error where user blocked from email can still send email to another user.
Modified paths:
  • /trunk/phase3/includes/SpecialEmailuser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialEmailuser.php
@@ -13,8 +13,13 @@
1414 $target = isset($par) ? $par : $wgRequest->getVal( 'target' );
1515 $error = EmailUserForm::getPermissionsError( $target );
1616 if ( $error ) {
17 - $wgOut->showErrorPage( $error[0], $error[1] );
18 - return;
 17+ if ( $error[0] === "blockedemailuser" ) {
 18+ $wgOut->blockedPage();
 19+ return;
 20+ } else {
 21+ $wgOut->showErrorPage( $error[0], $error[1] );
 22+ return;
 23+ }
1924 }
2025
2126 $form = EmailUserForm::newFromURL( $target,
@@ -220,6 +225,11 @@
221226 wfDebug( "User can't send.\n" );
222227 return array( "mailnologin", "mailnologintext" );
223228 }
 229+
 230+ if( $wgUser->isBlockedFromEmailuser() ) {
 231+ wfDebug( "User is blocked from sending e-mail.\n" );
 232+ return array( "blockedemailuser", "" );
 233+ }
224234
225235 if ( "" == $target ) {
226236 wfDebug( "Target is empty.\n" );

Status & tagging log