$this->BlockCreateAccount = $wgRequest->getBool( 'wpCreateAccount', $byDefault );
$this->BlockEnableAutoblock = $wgRequest->getBool( 'wpEnableAutoblock', $byDefault );
$this->BlockEmail = false;
- if( $wgEnableUserEmail && $wgSysopEmailBans && $wgUser->isAllowed( 'blockemail' ) ) {
+ if( self::canBlockEmail( $wgUser ) ) {
$this->BlockEmail = $wgRequest->getBool( 'wpEmailBan', false );
}
$this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false );
</tr>"
);
- global $wgSysopEmailBans, $wgBlockAllowsUTEdit, $wgEnableUserEmail;
- if( $wgEnableUserEmail && $wgSysopEmailBans && $wgUser->isAllowed( 'blockemail' ) ) {
+ if( self::canBlockEmail( $wgUser ) ) {
$wgOut->addHTML("
<tr id='wpEnableEmailBan'>
<td> </td>
</td>
</tr>"
);
+
+ # Can we explicitly disallow the use of user_talk?
+ global $wgBlockAllowsUTEdit;
if( $wgBlockAllowsUTEdit ){
$wgOut->addHTML("
<tr id='wpAllowUsertalkRow'>
$this->showLogFragment( $wgOut, Title::makeTitle( NS_USER, $this->BlockAddress ) );
}
}
+
+ /**
+ * Can we do an email block?
+ * @param User $user The sysop wanting to make a block
+ * @return boolean
+ */
+ protected function canBlockEmail( $user ) {
+ global $wgEnableUserEmail, $wgSysopEmailBans;
+ return ($wgEnableUserEmail && $wgSysopEmailBans && $user->isAllowed( 'blockemail' ));
+ }
/**
* Backend block code.