Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1618,6 +1618,7 @@ |
1619 | 1619 | 'ipb_expiry_invalid', |
1620 | 1620 | 'ipb_expiry_temp', |
1621 | 1621 | 'ipb_already_blocked', |
| 1622 | + 'ipb_tweak_block', |
1622 | 1623 | 'ipb_modifying_block', |
1623 | 1624 | 'ipb_tweak_block', |
1624 | 1625 | 'ipb_cant_unblock', |
Index: trunk/phase3/includes/SpecialBlockip.php |
— | — | @@ -32,10 +32,8 @@ |
33 | 33 | } else if ( $wgRequest->wasPosted() && 'submit' == $action && |
34 | 34 | $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { |
35 | 35 | $ipb->doSubmit(); |
36 | | - } else if ( $ipb->AlreadyBlocked ) { |
37 | | - $ipb->showForm( wfMsg('ipb_tweak_block', $ipb->BlockAddress ) ); |
38 | 36 | } else { |
39 | | - $ipb->showForm(''); |
| 37 | + $ipb->showForm( '' ); |
40 | 38 | } |
41 | 39 | } |
42 | 40 | |
— | — | @@ -49,32 +47,10 @@ |
50 | 48 | # var $BlockEmail; |
51 | 49 | |
52 | 50 | function IPBlockForm( $par ) { |
53 | | - global $wgRequest, $wgUser, $wgLang; |
| 51 | + global $wgRequest, $wgUser; |
54 | 52 | |
55 | 53 | $this->BlockAddress = $wgRequest->getVal( 'wpBlockAddress', $wgRequest->getVal( 'ip', $par ) ); |
56 | 54 | $this->BlockAddress = strtr( $this->BlockAddress, '_', ' ' ); |
57 | | - $this->AlreadyBlocked = false; |
58 | | - |
59 | | - if( $this->BlockAddress && !$wgRequest->wasPosted() ){ |
60 | | - $this->mBlock = new Block(); |
61 | | - if( $this->mBlock->load($this->BlockAddress) && $this->BlockAddress == $this->mBlock->mAddress ) { |
62 | | - $this->AlreadyBlocked = true; |
63 | | - $this->BlockReason = wfMsgForContent( 'ipb_modifying_block' ); |
64 | | - $this->BlockReasonList = $wgRequest->getText( 'wpBlockReasonList' ); |
65 | | - $this->BlockExpiry = wfMsg('ipbotheroption'); |
66 | | - $this->BlockOther = $wgLang->timeanddate( $this->mBlock->mExpiry ); |
67 | | - $this->BlockAnonOnly = $wgRequest->getBool( 'wpAnonOnly', true ); |
68 | | - $this->BlockCreateAccount = $wgRequest->getBool( 'wpCreateAccount', true ); |
69 | | - $this->BlockEnableAutoblock = $wgRequest->getBool( 'wpEnableAutoblock', true ); |
70 | | - $this->BlockEmail = $wgRequest->getBool( 'wpEmailBan', false ); |
71 | | - $this->BlockEmail = $this->mBlock->mBlockEmail; |
72 | | - $this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false ); |
73 | | - # Re-check user's rights to hide names, very serious, defaults to 0 |
74 | | - $this->BlockHideName = ( $this->mBlock->mHideName && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0; |
75 | | - return true; |
76 | | - } |
77 | | - } |
78 | | - |
79 | 55 | $this->BlockReason = $wgRequest->getText( 'wpBlockReason' ); |
80 | 56 | $this->BlockReasonList = $wgRequest->getText( 'wpBlockReasonList' ); |
81 | 57 | $this->BlockExpiry = $wgRequest->getVal( 'wpBlockExpiry', wfMsg('ipbotheroption') ); |
— | — | @@ -93,7 +69,7 @@ |
94 | 70 | } |
95 | 71 | |
96 | 72 | function showForm( $err ) { |
97 | | - global $wgOut, $wgUser, $wgSysopUserBans, $wgRequest; |
| 73 | + global $wgOut, $wgUser, $wgSysopUserBans; |
98 | 74 | |
99 | 75 | $wgOut->setPagetitle( wfMsg( 'blockip' ) ); |
100 | 76 | $wgOut->addWikiMsg( 'blockiptext' ); |
— | — | @@ -110,10 +86,8 @@ |
111 | 87 | |
112 | 88 | $titleObj = SpecialPage::getTitleFor( 'Blockip' ); |
113 | 89 | |
114 | | - if ( $wgRequest->wasPosted() ) { |
115 | | - $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) ); |
116 | | - } |
117 | 90 | if ( "" != $err ) { |
| 91 | + $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) ); |
118 | 92 | $wgOut->addHTML( Xml::tags( 'p', array( 'class' => 'error' ), $err ) ); |
119 | 93 | } |
120 | 94 | |
— | — | @@ -388,12 +362,10 @@ |
389 | 363 | |
390 | 364 | if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) { |
391 | 365 | |
392 | | - if ( $oldblock = Block::newFromDB( $this->BlockAddress ) && $oldblock->mAddress == $this->BlockAddress ) { |
393 | | - $oldblock->delete(); // Block already exists. Silently delete it |
| 366 | + if ( !$block->insert() ) { |
| 367 | + return array('ipb_already_blocked', htmlspecialchars($this->BlockAddress)); |
394 | 368 | } |
395 | | - $block->insert(); |
396 | 369 | |
397 | | - |
398 | 370 | wfRunHooks('BlockIpComplete', array($block, $wgUser)); |
399 | 371 | |
400 | 372 | if ( $this->BlockWatchUser ) { |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2363,9 +2363,6 @@ |
2364 | 2364 | 'ipb_expiry_invalid' => 'Expiry time invalid.', |
2365 | 2365 | 'ipb_expiry_temp' => 'Hidden username blocks should be permanent.', |
2366 | 2366 | 'ipb_already_blocked' => '"$1" is already blocked', |
2367 | | -'ipb_modifying_block' => 'Modifying existing block:', |
2368 | | -'ipb_tweak_block' => 'Caution: This user ($1) is already blocked. |
2369 | | -You can use this form to change the block settings.', |
2370 | 2367 | 'ipb_cant_unblock' => 'Error: Block ID $1 not found. It may have been unblocked already.', |
2371 | 2368 | 'ipb_blocked_as_range' => 'Error: The IP $1 is not blocked directly and cannot be unblocked. |
2372 | 2369 | It is, however, blocked as part of the range $2, which can be unblocked.', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -342,7 +342,6 @@ |
343 | 343 | * (bug 14385) "Move subpages" option no longer tries to move to invalid titles |
344 | 344 | * (bug 14386) Fix subpage namespace oddity when moving a talk page |
345 | 345 | * (bug 11771) Signup form now not shown if in read-only mode. |
346 | | -* (bug 10080) Users can now modify an existing block without unblocking first. |
347 | 346 | * (bug 12859) $wgRateLimitsExcludedGroups has been deprecated in favor of |
348 | 347 | $wgGroupPermissions[]['noratelimit']. |
349 | 348 | * (Bug 13828) Split parameter $1 of MediaWiki:Missingarticle into $1 (=title) |