From: Kwan Ting Chan Date: Thu, 15 May 2008 03:49:51 +0000 (+0000) Subject: Fix error where user blocked from email can still send email to another user. X-Git-Tag: 1.31.0-rc.0~47621 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=53613e5b905ad5c2a93d1c82e9beb5626152334b;p=lhc%2Fweb%2Fwiklou.git Fix error where user blocked from email can still send email to another user. --- diff --git a/includes/SpecialEmailuser.php b/includes/SpecialEmailuser.php index 274325f086..b3f43ba643 100644 --- a/includes/SpecialEmailuser.php +++ b/includes/SpecialEmailuser.php @@ -13,8 +13,13 @@ function wfSpecialEmailuser( $par ) { $target = isset($par) ? $par : $wgRequest->getVal( 'target' ); $error = EmailUserForm::getPermissionsError( $target ); if ( $error ) { - $wgOut->showErrorPage( $error[0], $error[1] ); - return; + if ( $error[0] === "blockedemailuser" ) { + $wgOut->blockedPage(); + return; + } else { + $wgOut->showErrorPage( $error[0], $error[1] ); + return; + } } $form = EmailUserForm::newFromURL( $target, @@ -220,6 +225,11 @@ class EmailUserForm { wfDebug( "User can't send.\n" ); return array( "mailnologin", "mailnologintext" ); } + + if( $wgUser->isBlockedFromEmailuser() ) { + wfDebug( "User is blocked from sending e-mail.\n" ); + return array( "blockedemailuser", "" ); + } if ( "" == $target ) { wfDebug( "Target is empty.\n" );