Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1745,6 +1745,7 @@ |
1746 | 1746 | 'ipbhidename', |
1747 | 1747 | 'ipbwatchuser', |
1748 | 1748 | 'ipballowusertalk', |
| 1749 | + 'ipb-change-block', |
1749 | 1750 | 'badipaddress', |
1750 | 1751 | 'blockipsuccesssub', |
1751 | 1752 | 'blockipsuccesstext', |
— | — | @@ -1784,6 +1785,7 @@ |
1785 | 1786 | 'blocklogpage', |
1786 | 1787 | 'blocklog-fulllog', |
1787 | 1788 | 'blocklogentry', |
| 1789 | + 'reblock-logentry', |
1788 | 1790 | 'blocklogtext', |
1789 | 1791 | 'unblocklogentry', |
1790 | 1792 | 'block-log-flags-anononly', |
— | — | @@ -1796,6 +1798,7 @@ |
1797 | 1799 | 'ipb_expiry_invalid', |
1798 | 1800 | 'ipb_expiry_temp', |
1799 | 1801 | 'ipb_already_blocked', |
| 1802 | + 'ipb-needreblock', |
1800 | 1803 | 'ipb_cant_unblock', |
1801 | 1804 | 'ipb_blocked_as_range', |
1802 | 1805 | 'ip_range_invalid', |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2762,6 +2762,7 @@ |
2763 | 2763 | $wgLogActions = array( |
2764 | 2764 | 'block/block' => 'blocklogentry', |
2765 | 2765 | 'block/unblock' => 'unblocklogentry', |
| 2766 | + 'block/reblock' => 'reblock-logentry', |
2766 | 2767 | 'protect/protect' => 'protectedarticle', |
2767 | 2768 | 'protect/modify' => 'modifiedarticleprotection', |
2768 | 2769 | 'protect/unprotect' => 'unprotectedarticle', |
Index: trunk/phase3/includes/LogPage.php |
— | — | @@ -196,7 +196,7 @@ |
197 | 197 | } else { |
198 | 198 | $details = ''; |
199 | 199 | array_unshift( $params, $titleLink ); |
200 | | - if ( $key == 'block/block' || $key == 'suppress/block' ) { |
| 200 | + if ( $key == 'block/block' || $key == 'suppress/block' || $key == 'block/reblock' ) { |
201 | 201 | if ( $skin ) { |
202 | 202 | $params[1] = '<span title="' . htmlspecialchars( $params[1] ). '">' . |
203 | 203 | $wgLang->translateBlockExpiry( $params[1] ) . '</span>'; |
Index: trunk/phase3/includes/specials/SpecialBlockip.php |
— | — | @@ -67,6 +67,7 @@ |
68 | 68 | # Re-check user's rights to hide names, very serious, defaults to 0 |
69 | 69 | $this->BlockHideName = ( $wgRequest->getBool( 'wpHideName', 0 ) && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0; |
70 | 70 | $this->BlockAllowUsertalk = ( $wgRequest->getBool( 'wpAllowUsertalk', $byDefault ) && $wgBlockAllowsUTEdit ); |
| 71 | + $this->BlockReblock = $wgRequest->getBool( 'wpChangeBlock', false ); |
71 | 72 | } |
72 | 73 | |
73 | 74 | function showForm( $err ) { |
— | — | @@ -86,10 +87,19 @@ |
87 | 88 | $mIpbreason = Xml::label( wfMsg( 'ipbotherreason' ), 'mw-bi-reason' ); |
88 | 89 | |
89 | 90 | $titleObj = SpecialPage::getTitleFor( 'Blockip' ); |
90 | | - |
91 | | - if ( "" != $err ) { |
| 91 | + |
| 92 | + $alreadyBlocked = false; |
| 93 | + if ( $err && $err[0] != 'ipb_already_blocked' ) { |
| 94 | + $key = array_shift($err); |
| 95 | + $msg = wfMsgReal($key, $err); |
92 | 96 | $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) ); |
93 | | - $wgOut->addHTML( Xml::tags( 'p', array( 'class' => 'error' ), $err ) ); |
| 97 | + $wgOut->addHTML( Xml::tags( 'p', array( 'class' => 'error' ), $msg ) ); |
| 98 | + } elseif ( $this->BlockAddress ) { |
| 99 | + $currentBlock = Block::newFromDB( $this->BlockAddress ); |
| 100 | + if ( !is_null($currentBlock) && !$currentBlock->mAuto && !($currentBlock->mRangeStart && $currentBlock->mAddress != $this->BlockAddress) ) { |
| 101 | + $wgOut->addWikiMsg( 'ipb-needreblock', $this->BlockAddress ); |
| 102 | + $alreadyBlocked = true; |
| 103 | + } |
94 | 104 | } |
95 | 105 | |
96 | 106 | $scBlockExpiryOptions = wfMsgForContent( 'ipboptions' ); |
— | — | @@ -253,6 +263,18 @@ |
254 | 264 | </tr>" |
255 | 265 | ); |
256 | 266 | } |
| 267 | + if ( $alreadyBlocked ) { |
| 268 | + $wgOut->addHTML(" |
| 269 | + <tr id='wpChangeBlockRow'> |
| 270 | + <td> </td> |
| 271 | + <td class='mw-input'>" . |
| 272 | + Xml::checkLabel( wfMsg( 'ipb-change-block' ), |
| 273 | + 'wpChangeBlock', 'wpChangeBlock', $this->BlockReblock, |
| 274 | + array( 'tabindex' => '13' ) ) . " |
| 275 | + </td> |
| 276 | + </tr>" |
| 277 | + ); |
| 278 | + } |
257 | 279 | |
258 | 280 | $wgOut->addHTML(" |
259 | 281 | <tr> |
— | — | @@ -379,9 +401,18 @@ |
380 | 402 | if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) { |
381 | 403 | |
382 | 404 | if ( !$block->insert() ) { |
383 | | - return array('ipb_already_blocked', htmlspecialchars($this->BlockAddress)); |
| 405 | + if ( !$this->BlockReblock ) { |
| 406 | + return array( 'ipb_already_blocked' ); |
| 407 | + } else { |
| 408 | + # This returns direct blocks before autoblocks/rangeblocks, since we should be sure the user is blocked by now it should work for our purposes |
| 409 | + $currentBlock = Block::newFromDB( $this->BlockAddress ); |
| 410 | + $currentBlock->delete(); |
| 411 | + $block->insert(); |
| 412 | + $log_action = 'reblock'; |
| 413 | + } |
| 414 | + } else { |
| 415 | + $log_action = 'block'; |
384 | 416 | } |
385 | | - |
386 | 417 | wfRunHooks('BlockIpComplete', array($block, $wgUser)); |
387 | 418 | |
388 | 419 | if ( $this->BlockWatchUser ) { |
— | — | @@ -396,7 +427,7 @@ |
397 | 428 | # Make log entry, if the name is hidden, put it in the oversight log |
398 | 429 | $log_type = ($this->BlockHideName) ? 'suppress' : 'block'; |
399 | 430 | $log = new LogPage( $log_type ); |
400 | | - $log->addEntry( 'block', Title::makeTitle( NS_USER, $this->BlockAddress ), |
| 431 | + $log->addEntry( $log_action, Title::makeTitle( NS_USER, $this->BlockAddress ), |
401 | 432 | $reasonstr, $logParams ); |
402 | 433 | |
403 | 434 | # Report to the user |
— | — | @@ -420,8 +451,7 @@ |
421 | 452 | urlencode( $this->BlockAddress ) ) ); |
422 | 453 | return; |
423 | 454 | } |
424 | | - $key = array_shift($retval); |
425 | | - $this->showForm(wfMsgReal($key, $retval)); |
| 455 | + $this->showForm( $retval ); |
426 | 456 | } |
427 | 457 | |
428 | 458 | function showSuccess() { |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2552,6 +2552,7 @@ |
2553 | 2553 | 'ipbhidename' => 'Hide username from the block log, active block list and user list', |
2554 | 2554 | 'ipbwatchuser' => "Watch this user's user and talk pages", |
2555 | 2555 | 'ipballowusertalk' => 'Allow this user to edit own talk page while blocked', |
| 2556 | +'ipb-change-block' => 'Re-block the user with these settings', |
2556 | 2557 | 'badipaddress' => 'Invalid IP address', |
2557 | 2558 | 'blockipsuccesssub' => 'Block succeeded', |
2558 | 2559 | 'blockipsuccesstext' => '[[Special:Contributions/$1|$1]] has been blocked.<br /> |
— | — | @@ -2593,6 +2594,7 @@ |
2594 | 2595 | 'blocklogpage' => 'Block log', |
2595 | 2596 | 'blocklog-fulllog' => 'Full block log', |
2596 | 2597 | 'blocklogentry' => 'blocked [[$1]] with an expiry time of $2 $3', |
| 2598 | +'reblock-logentry' => 'changed block settings for [[$1]] with an expiry time of $2 $3', |
2597 | 2599 | 'blocklogtext' => 'This is a log of user blocking and unblocking actions. |
2598 | 2600 | Automatically blocked IP addresses are not listed. |
2599 | 2601 | See the [[Special:IPBlockList|IP block list]] for the list of currently operational bans and blocks.', |
— | — | @@ -2607,6 +2609,8 @@ |
2608 | 2610 | 'ipb_expiry_invalid' => 'Expiry time invalid.', |
2609 | 2611 | 'ipb_expiry_temp' => 'Hidden username blocks must be permanent.', |
2610 | 2612 | 'ipb_already_blocked' => '"$1" is already blocked', |
| 2613 | +'ipb-needreblock' => '== Already blocked == |
| 2614 | +$1 is already blocked. Do you want to change the settings?', |
2611 | 2615 | 'ipb_cant_unblock' => 'Error: Block ID $1 not found. |
2612 | 2616 | It may have been unblocked already.', |
2613 | 2617 | 'ipb_blocked_as_range' => 'Error: The IP $1 is not blocked directly and cannot be unblocked. |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -179,6 +179,9 @@ |
180 | 180 | * Make search matches bold only, not red as well |
181 | 181 | * Added 'UserRights::showEditUserGroupsForm' hook to allow extensions to alter |
182 | 182 | the groups that the user can be added to or removed from in Special:UserRights |
| 183 | +* (bug 10080) Blocks can be modified without unblocking first |
| 184 | +* (bug 15820) Special:BlockIP shows a notice if the user being blocked is already |
| 185 | + directly blocked |
183 | 186 | |
184 | 187 | === Bug fixes in 1.14 === |
185 | 188 | |