r41275 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41274‎ | r41275 | r41276 >
Date:00:28, 26 September 2008
Author:mattj
Status:old
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/specials/SpecialBlockip.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialBlockip.php
@@ -66,11 +66,7 @@
6767 $this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false );
6868 # Re-check user's rights to hide names, very serious, defaults to 0
6969 $this->BlockHideName = ( $wgRequest->getBool( 'wpHideName', 0 ) && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0;
70 - if($wgRequest->wasPosted()){
71 - $this->BlockAllowUsertalk = $wgRequest->getBool( 'wpAllowUsertalk', false );
72 - }else{
73 - $this->BlockAllowUsertalk = $wgBlockAllowsUTEdit;
74 - }
 70+ $this->BlockAllowUsertalk = ( $wgRequest->getBool( 'wpAllowUsertalk', $byDefault ) && $wgBlockAllowsUTEdit );
7571 }
7672
7773 function showForm( $err ) {
@@ -206,7 +202,7 @@
207203 </tr>"
208204 );
209205
210 - global $wgSysopEmailBans;
 206+ global $wgSysopEmailBans, $wgBlockAllowsUTEdit;
211207 if ( $wgSysopEmailBans && $wgUser->isAllowed( 'blockemail' ) ) {
212208 $wgOut->addHTML("
213209 <tr id='wpEnableEmailBan'>
@@ -243,16 +239,20 @@
244240 'wpWatchUser', 'wpWatchUser', $this->BlockWatchUser,
245241 array( 'tabindex' => '11' ) ) . "
246242 </td>
247 - </tr>
248 - <tr id='wpAllowUsertalkRow'>
249 - <td>&nbsp;</td>
250 - <td class='mw-input'>" .
251 - Xml::checkLabel( wfMsg( 'ipballowusertalk' ),
252 - 'wpAllowUsertalk', 'wpAllowUsertalk', $this->BlockAllowUsertalk,
253 - array( 'tabindex' => '12' ) ) . "
254 - </td>
255243 </tr>"
256244 );
 245+ if( $wgBlockAllowsUTEdit ){
 246+ $wgOut->addHTML("
 247+ <tr id='wpAllowUsertalkRow'>
 248+ <td>&nbsp;</td>
 249+ <td class='mw-input'>" .
 250+ Xml::checkLabel( wfMsg( 'ipballowusertalk' ),
 251+ 'wpAllowUsertalk', 'wpAllowUsertalk', $this->BlockAllowUsertalk,
 252+ array( 'tabindex' => '12' ) ) . "
 253+ </td>
 254+ </tr>"
 255+ );
 256+ }
257257
258258 $wgOut->addHTML("
259259 <tr>
@@ -455,6 +455,7 @@
456456 * @return array
457457 */
458458 private function blockLogFlags() {
 459+ global $wgBlockAllowsUTEdit;
459460 $flags = array();
460461 if( $this->BlockAnonOnly && IP::isIPAddress( $this->BlockAddress ) )
461462 // when blocking a user the option 'anononly' is not available/has no effect -> do not write this into log
@@ -465,7 +466,7 @@
466467 $flags[] = 'noautoblock';
467468 if ( $this->BlockEmail )
468469 $flags[] = 'noemail';
469 - if ( !$this->BlockAllowUsertalk )
 470+ if ( !$this->BlockAllowUsertalk && $wgBlockAllowsUTEdit )
470471 $flags[] = 'nousertalk';
471472 return implode( ',', $flags );
472473 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41248(bug 8440) Allow preventing blocked users from editing their talk pages...mattj11:45, 25 September 2008