From: Chad Horohoe Date: Sat, 23 May 2009 00:05:40 +0000 (+0000) Subject: Followup to r50744: Actually declare the method as public static, and use it in the API X-Git-Tag: 1.31.0-rc.0~41685 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=354fbf19af5f1cea7956d67ca8fcee56b4a8b667;p=lhc%2Fweb%2Fwiklou.git Followup to r50744: Actually declare the method as public static, and use it in the API --- diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index acfd39e2cf..9220d54731 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -49,7 +49,7 @@ class ApiBlock extends ApiBase { * of success. If it fails, the result will specify the nature of the error. */ public function execute() { - global $wgUser, $wgBlockAllowsUTEdit, $wgEnableUserEmail, $wgSysopEmailBans; + global $wgUser, $wgBlockAllowsUTEdit; $params = $this->extractRequestParams(); if($params['gettoken']) @@ -69,7 +69,7 @@ class ApiBlock extends ApiBase { $this->dieUsageMsg(array('cantblock')); if($params['hidename'] && !$wgUser->isAllowed('hideuser')) $this->dieUsageMsg(array('canthide')); - if($params['noemail'] && $wgEnableUserEmail && $wgSysopEmailBans && !$wgUser->isAllowed('blockemail')) + if($params['noemail'] && !IPBlockForm::canBlockEmail($wgUser) ) $this->dieUsageMsg(array('cantblock-email')); $form = new IPBlockForm(''); diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 9d5dd296b4..58547a23ac 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -319,7 +319,7 @@ class IPBlockForm { * @param User $user The sysop wanting to make a block * @return boolean */ - protected function canBlockEmail( $user ) { + public static function canBlockEmail( $user ) { global $wgEnableUserEmail, $wgSysopEmailBans; return ($wgEnableUserEmail && $wgSysopEmailBans && $user->isAllowed( 'blockemail' )); }