From 62a781fc880d5e975c592e06cce8809fb3fc144a Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Fri, 26 Sep 2008 00:28:46 +0000 Subject: [PATCH] Fix r41248 per Chad's suggestions on Wikitech. $wgBlockAllowsUTEdit now enables the check box, if it is false no option is given to sysops at all --- includes/specials/SpecialBlockip.php | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 44593f4afd..7f99661410 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -66,11 +66,7 @@ class IPBlockForm { $this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false ); # Re-check user's rights to hide names, very serious, defaults to 0 $this->BlockHideName = ( $wgRequest->getBool( 'wpHideName', 0 ) && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0; - if($wgRequest->wasPosted()){ - $this->BlockAllowUsertalk = $wgRequest->getBool( 'wpAllowUsertalk', false ); - }else{ - $this->BlockAllowUsertalk = $wgBlockAllowsUTEdit; - } + $this->BlockAllowUsertalk = ( $wgRequest->getBool( 'wpAllowUsertalk', $byDefault ) && $wgBlockAllowsUTEdit ); } function showForm( $err ) { @@ -206,7 +202,7 @@ class IPBlockForm { " ); - global $wgSysopEmailBans; + global $wgSysopEmailBans, $wgBlockAllowsUTEdit; if ( $wgSysopEmailBans && $wgUser->isAllowed( 'blockemail' ) ) { $wgOut->addHTML(" @@ -243,16 +239,20 @@ class IPBlockForm { 'wpWatchUser', 'wpWatchUser', $this->BlockWatchUser, array( 'tabindex' => '11' ) ) . " - - -   - " . - Xml::checkLabel( wfMsg( 'ipballowusertalk' ), - 'wpAllowUsertalk', 'wpAllowUsertalk', $this->BlockAllowUsertalk, - array( 'tabindex' => '12' ) ) . " - " ); + if( $wgBlockAllowsUTEdit ){ + $wgOut->addHTML(" + +   + " . + Xml::checkLabel( wfMsg( 'ipballowusertalk' ), + 'wpAllowUsertalk', 'wpAllowUsertalk', $this->BlockAllowUsertalk, + array( 'tabindex' => '12' ) ) . " + + " + ); + } $wgOut->addHTML(" @@ -455,6 +455,7 @@ class IPBlockForm { * @return array */ private function blockLogFlags() { + global $wgBlockAllowsUTEdit; $flags = array(); if( $this->BlockAnonOnly && IP::isIPAddress( $this->BlockAddress ) ) // when blocking a user the option 'anononly' is not available/has no effect -> do not write this into log @@ -465,7 +466,7 @@ class IPBlockForm { $flags[] = 'noautoblock'; if ( $this->BlockEmail ) $flags[] = 'noemail'; - if ( !$this->BlockAllowUsertalk ) + if ( !$this->BlockAllowUsertalk && $wgBlockAllowsUTEdit ) $flags[] = 'nousertalk'; return implode( ',', $flags ); } -- 2.20.1