Index: trunk/phase3/includes/Linker.php |
— | — | @@ -880,9 +880,9 @@ |
881 | 881 | * @return String: HTML fragment |
882 | 882 | */ |
883 | 883 | public function userToolLinks( $userId, $userText, $redContribsWhenNoEdits = false, $flags = 0, $edits = null ) { |
884 | | - global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans, $wgLang; |
| 884 | + global $wgUser, $wgDisableAnonTalk, $wgLang; |
885 | 885 | $talkable = !( $wgDisableAnonTalk && 0 == $userId ); |
886 | | - $blockable = ( $wgSysopUserBans || 0 == $userId ) && !$flags & self::TOOL_LINKS_NOBLOCK; |
| 886 | + $blockable = !$flags & self::TOOL_LINKS_NOBLOCK; |
887 | 887 | |
888 | 888 | $items = array(); |
889 | 889 | if ( $talkable ) { |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -3175,10 +3175,16 @@ |
3176 | 3176 | * @{ |
3177 | 3177 | */ |
3178 | 3178 | |
3179 | | -/** Allow sysops to ban logged-in users */ |
| 3179 | +/** |
| 3180 | + * Allow sysops to ban logged-in users |
| 3181 | + * @deprecated @since 1.18 |
| 3182 | + */ |
3180 | 3183 | $wgSysopUserBans = true; |
3181 | 3184 | |
3182 | | -/** Allow sysops to ban IP ranges */ |
| 3185 | +/** |
| 3186 | + * Allow sysops to ban IP ranges |
| 3187 | + * @deprecated @since 1.18; set $wgBlockCIDRLimit to array( 'IPv4' => 32, 'IPv6 => 128 ) instead. |
| 3188 | + */ |
3183 | 3189 | $wgSysopRangeBans = true; |
3184 | 3190 | |
3185 | 3191 | /** |
Index: trunk/phase3/includes/specials/SpecialIpblocklist.php |
— | — | @@ -121,7 +121,7 @@ |
122 | 122 | * @return $out string: HTML form |
123 | 123 | */ |
124 | 124 | function showForm( $err = null ) { |
125 | | - global $wgOut, $wgUser, $wgSysopUserBans; |
| 125 | + global $wgOut, $wgUser; |
126 | 126 | |
127 | 127 | $wgOut->addWikiMsg( 'unblockiptext' ); |
128 | 128 | |
— | — | @@ -139,12 +139,12 @@ |
140 | 140 | $encName = htmlspecialchars( $block->getRedactedName() ); |
141 | 141 | $encId = $this->id; |
142 | 142 | $addressPart = $encName . Html::hidden( 'id', $encId ); |
143 | | - $ipa = wfMsgHtml( $wgSysopUserBans ? 'ipadressorusername' : 'ipaddress' ); |
| 143 | + $ipa = wfMsgHtml( 'ipadressorusername' ); |
144 | 144 | } |
145 | 145 | } |
146 | 146 | if ( !$addressPart ) { |
147 | 147 | $addressPart = Xml::input( 'wpUnblockAddress', 40, $this->ip, array( 'type' => 'text', 'tabindex' => '1' ) ); |
148 | | - $ipa = Xml::label( wfMsg( $wgSysopUserBans ? 'ipadressorusername' : 'ipaddress' ), 'wpUnblockAddress' ); |
| 148 | + $ipa = Xml::label( wfMsg( 'ipadressorusername' ), 'wpUnblockAddress' ); |
149 | 149 | } |
150 | 150 | |
151 | 151 | $wgOut->addHTML( |
Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -240,7 +240,6 @@ |
241 | 241 | * @param $subject User: The viewing user ($wgUser is still checked in some cases, like userrights page!!) |
242 | 242 | */ |
243 | 243 | public static function getUserLinks( Title $userpage, Title $talkpage, User $target, User $subject ) { |
244 | | - global $wgSysopUserBans; |
245 | 244 | |
246 | 245 | $sk = $subject->getSkin(); |
247 | 246 | $id = $target->getId(); |
— | — | @@ -248,7 +247,7 @@ |
249 | 248 | |
250 | 249 | $tools[] = $sk->link( $talkpage, wfMsgHtml( 'sp-contributions-talk' ) ); |
251 | 250 | |
252 | | - if( ( $id !== null && $wgSysopUserBans ) || ( $id === null && IP::isIPAddress( $username ) ) ) { |
| 251 | + if( ( $id !== null ) || ( $id === null && IP::isIPAddress( $username ) ) ) { |
253 | 252 | if( $subject->isAllowed( 'block' ) ) { # Block / Change block / Unblock links |
254 | 253 | if ( $target->isBlocked() ) { |
255 | 254 | $tools[] = $sk->linkKnown( # Change block link |
Index: trunk/phase3/includes/specials/SpecialBlockip.php |
— | — | @@ -106,16 +106,12 @@ |
107 | 107 | } |
108 | 108 | |
109 | 109 | public function showForm( $err ) { |
110 | | - global $wgOut, $wgUser, $wgSysopUserBans; |
| 110 | + global $wgOut, $wgUser; |
111 | 111 | |
112 | 112 | $wgOut->setPageTitle( wfMsg( 'blockip-title' ) ); |
113 | 113 | $wgOut->addWikiMsg( 'blockiptext' ); |
114 | 114 | |
115 | | - if( $wgSysopUserBans ) { |
116 | | - $mIpaddress = Xml::label( wfMsg( 'ipadressorusername' ), 'mw-bi-target' ); |
117 | | - } else { |
118 | | - $mIpaddress = Xml::label( wfMsg( 'ipaddress' ), 'mw-bi-target' ); |
119 | | - } |
| 115 | + $mIpaddress = Xml::label( wfMsg( 'ipadressorusername' ), 'mw-bi-target' ); |
120 | 116 | $mIpbexpiry = Xml::label( wfMsg( 'ipbexpiry' ), 'wpBlockExpiry' ); |
121 | 117 | $mIpbother = Xml::label( wfMsg( 'ipbother' ), 'mw-bi-other' ); |
122 | 118 | $mIpbreasonother = Xml::label( wfMsg( 'ipbreason' ), 'wpBlockReasonList' ); |
— | — | @@ -426,7 +422,7 @@ |
427 | 423 | * @return array(message key, arguments) on failure, empty array on success |
428 | 424 | */ |
429 | 425 | function doBlock( &$userId = null, &$expiry = null ) { |
430 | | - global $wgUser, $wgSysopUserBans, $wgSysopRangeBans, $wgBlockAllowsUTEdit, $wgBlockCIDRLimit; |
| 426 | + global $wgUser, $wgBlockAllowsUTEdit, $wgBlockCIDRLimit; |
431 | 427 | |
432 | 428 | $userId = 0; |
433 | 429 | # Expand valid IPv6 addresses, usernames are left as is |
— | — | @@ -441,7 +437,7 @@ |
442 | 438 | $matches = array(); |
443 | 439 | if( preg_match( "/^($rxIP4)\\/(\\d{1,2})$/", $this->BlockAddress, $matches ) ) { |
444 | 440 | # IPv4 |
445 | | - if( $wgSysopRangeBans ) { |
| 441 | + if( $wgBlockCIDRLimit['IPv4'] != 32 ){ |
446 | 442 | if( !IP::isIPv4( $this->BlockAddress ) || $matches[2] > 32 ) { |
447 | 443 | return array( 'ip_range_invalid' ); |
448 | 444 | } elseif ( $matches[2] < $wgBlockCIDRLimit['IPv4'] ) { |
— | — | @@ -454,7 +450,7 @@ |
455 | 451 | } |
456 | 452 | } elseif( preg_match( "/^($rxIP6)\\/(\\d{1,3})$/", $this->BlockAddress, $matches ) ) { |
457 | 453 | # IPv6 |
458 | | - if( $wgSysopRangeBans ) { |
| 454 | + if( $wgBlockCIDRLimit['IPv6'] != 128 ) { |
459 | 455 | if( !IP::isIPv6( $this->BlockAddress ) || $matches[2] > 128 ) { |
460 | 456 | return array( 'ip_range_invalid' ); |
461 | 457 | } elseif( $matches[2] < $wgBlockCIDRLimit['IPv6'] ) { |
— | — | @@ -467,17 +463,13 @@ |
468 | 464 | } |
469 | 465 | } else { |
470 | 466 | # Username block |
471 | | - if( $wgSysopUserBans ) { |
472 | | - $user = User::newFromName( $this->BlockAddress ); |
473 | | - if( $user instanceof User && $user->getId() ) { |
474 | | - # Use canonical name |
475 | | - $userId = $user->getId(); |
476 | | - $this->BlockAddress = $user->getName(); |
477 | | - } else { |
478 | | - return array( 'nosuchusershort', htmlspecialchars( $user ? $user->getName() : $this->BlockAddress ) ); |
479 | | - } |
| 467 | + $user = User::newFromName( $this->BlockAddress ); |
| 468 | + if( $user instanceof User && $user->getId() ) { |
| 469 | + # Use canonical name |
| 470 | + $userId = $user->getId(); |
| 471 | + $this->BlockAddress = $user->getName(); |
480 | 472 | } else { |
481 | | - return array( 'badipaddress' ); |
| 473 | + return array( 'nosuchusershort', htmlspecialchars( $user ? $user->getName() : $this->BlockAddress ) ); |
482 | 474 | } |
483 | 475 | } |
484 | 476 | } |
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php |
— | — | @@ -354,7 +354,7 @@ |
355 | 355 | * @todo Fixme: almost the same as contributionsSub in SpecialContributions.php. Could be combined. |
356 | 356 | */ |
357 | 357 | function getSubTitle( $nt, $id ) { |
358 | | - global $wgSysopUserBans, $wgLang, $wgUser, $wgOut; |
| 358 | + global $wgLang, $wgUser, $wgOut; |
359 | 359 | |
360 | 360 | $sk = $wgUser->getSkin(); |
361 | 361 | |
— | — | @@ -368,7 +368,7 @@ |
369 | 369 | if( $talk ) { |
370 | 370 | # Talk page link |
371 | 371 | $tools[] = $sk->link( $talk, wfMsgHtml( 'sp-contributions-talk' ) ); |
372 | | - if( ( $id !== null && $wgSysopUserBans ) || ( $id === null && IP::isIPAddress( $nt->getText() ) ) ) { |
| 372 | + if( ( $id !== null ) || ( $id === null && IP::isIPAddress( $nt->getText() ) ) ) { |
373 | 373 | if( $wgUser->isAllowed( 'block' ) ) { # Block / Change block / Unblock links |
374 | 374 | if ( $userObj->isBlocked() ) { |
375 | 375 | $tools[] = $sk->linkKnown( # Change block link |
Index: trunk/extensions/CleanChanges/CleanChanges_body.php |
— | — | @@ -432,9 +432,8 @@ |
433 | 433 | * Enhanced user tool links, with javascript functionality. |
434 | 434 | */ |
435 | 435 | public function userToolLinks( $userId, $userText ) { |
436 | | - global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans; |
| 436 | + global $wgUser, $wgDisableAnonTalk; |
437 | 437 | $talkable = !( $wgDisableAnonTalk && 0 == $userId ); |
438 | | - $blockable = ( $wgSysopUserBans || 0 == $userId ); |
439 | 438 | |
440 | 439 | /* |
441 | 440 | * Assign each different user a running id. This is used to show user tool |
— | — | @@ -483,7 +482,7 @@ |
484 | 483 | $items[] = $this->skin->makeKnownLinkObj( $targetPage, |
485 | 484 | wfMsgHtml( 'contribslink' ) ); |
486 | 485 | } |
487 | | - if( $blockable && $wgUser->isAllowed( 'block' ) ) { |
| 486 | + if( $wgUser->isAllowed( 'block' ) ) { |
488 | 487 | $items[] = $this->skin->blockLink( $userId, $userText ); |
489 | 488 | } |
490 | 489 | if( $userId ) { |