From 53613e5b905ad5c2a93d1c82e9beb5626152334b Mon Sep 17 00:00:00 2001 From: Kwan Ting Chan Date: Thu, 15 May 2008 03:49:51 +0000 Subject: [PATCH] Fix error where user blocked from email can still send email to another user. --- includes/SpecialEmailuser.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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" ); -- 2.20.1