* 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'])
$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('');
* @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' ));
}