Index: trunk/phase3/includes/specials/SpecialBlockip.php |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | $this->BlockCreateAccount = $wgRequest->getBool( 'wpCreateAccount', $byDefault ); |
64 | 64 | $this->BlockEnableAutoblock = $wgRequest->getBool( 'wpEnableAutoblock', $byDefault ); |
65 | 65 | $this->BlockEmail = false; |
66 | | - if( $wgEnableUserEmail && $wgSysopEmailBans && $wgUser->isAllowed( 'blockemail' ) ) { |
| 66 | + if( self::canBlockEmail( $wgUser ) ) { |
67 | 67 | $this->BlockEmail = $wgRequest->getBool( 'wpEmailBan', false ); |
68 | 68 | } |
69 | 69 | $this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false ); |
— | — | @@ -233,8 +233,7 @@ |
234 | 234 | </tr>" |
235 | 235 | ); |
236 | 236 | |
237 | | - global $wgSysopEmailBans, $wgBlockAllowsUTEdit, $wgEnableUserEmail; |
238 | | - if( $wgEnableUserEmail && $wgSysopEmailBans && $wgUser->isAllowed( 'blockemail' ) ) { |
| 237 | + if( self::canBlockEmail( $wgUser ) ) { |
239 | 238 | $wgOut->addHTML(" |
240 | 239 | <tr id='wpEnableEmailBan'> |
241 | 240 | <td> </td> |
— | — | @@ -272,6 +271,9 @@ |
273 | 272 | </td> |
274 | 273 | </tr>" |
275 | 274 | ); |
| 275 | + |
| 276 | + # Can we explicitly disallow the use of user_talk? |
| 277 | + global $wgBlockAllowsUTEdit; |
276 | 278 | if( $wgBlockAllowsUTEdit ){ |
277 | 279 | $wgOut->addHTML(" |
278 | 280 | <tr id='wpAllowUsertalkRow'> |
— | — | @@ -311,6 +313,16 @@ |
312 | 314 | $this->showLogFragment( $wgOut, Title::makeTitle( NS_USER, $this->BlockAddress ) ); |
313 | 315 | } |
314 | 316 | } |
| 317 | + |
| 318 | + /** |
| 319 | + * Can we do an email block? |
| 320 | + * @param User $user The sysop wanting to make a block |
| 321 | + * @return boolean |
| 322 | + */ |
| 323 | + protected function canBlockEmail( $user ) { |
| 324 | + global $wgEnableUserEmail, $wgSysopEmailBans; |
| 325 | + return ($wgEnableUserEmail && $wgSysopEmailBans && $user->isAllowed( 'blockemail' )); |
| 326 | + } |
315 | 327 | |
316 | 328 | /** |
317 | 329 | * Backend block code. |