From: Andrew Garrett Date: Thu, 28 May 2009 10:00:53 +0000 (+0000) Subject: Prevent Tor users from emailing other users X-Git-Tag: 1.31.0-rc.0~41624 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=372ee7b344c9f12a6207306ddcd82f1015a143d6;p=lhc%2Fweb%2Fwiklou.git Prevent Tor users from emailing other users --- diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index 58e2514e08..5bf2b579a1 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -48,6 +48,12 @@ function wfSpecialEmailuser( $par ) { case 'mailnologin': $wgOut->showErrorPage( 'mailnologin', 'mailnologintext' ); return; + default: + // It's a hook error + list( $title, $msg, $params ) = $error; + $wgOut->showErrorPage( $title, $msg, $params ); + return; + } } @@ -297,12 +303,17 @@ class EmailUserForm { return 'actionthrottledtext'; } + $hookErr = null; + wfRunHooks( 'EmailUserPermissionsErrors', array( $user, $editToken, &$hookErr ) ); + + if ($hookErr) { + return $hookErr; + } + if( !$user->matchEditToken( $editToken ) ) { wfDebug( "Matching edit token failed.\n" ); return 'sessionfailure'; } - - return; } static function newFromURL( $target, $text, $subject, $cc_me )