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_already_blocked', $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) ) { |
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 | |
— | — | @@ -384,10 +358,7 @@ |
385 | 359 | if (wfRunHooks('BlockIp', array(&$block, &$wgUser))) { |
386 | 360 | |
387 | 361 | if ( !$block->insert() ) { |
388 | | - // Block already exists. Silently delete the existing block and insert it again |
389 | | - $oldblock = Block::newFromDB( $this->BlockAddress ); |
390 | | - $oldblock->delete(); |
391 | | - $block->insert(); |
| 362 | + return array('ipb_already_blocked', htmlspecialchars($this->BlockAddress)); |
392 | 363 | } |
393 | 364 | |
394 | 365 | wfRunHooks('BlockIpComplete', array($block, $wgUser)); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2360,9 +2360,7 @@ |
2361 | 2361 | 'block-log-flags-noemail' => 'e-mail blocked', |
2362 | 2362 | 'range_block_disabled' => 'The sysop ability to create range blocks is disabled.', |
2363 | 2363 | 'ipb_expiry_invalid' => 'Expiry time invalid.', |
2364 | | -'ipb_already_blocked' => 'Caution: "$1" is already blocked. |
2365 | | -You can modify the block settings by using this form.', |
2366 | | -'ipb_modifying_block' => 'Modifying existing block:', |
| 2364 | +'ipb_already_blocked' => '"$1" is already blocked', |
2367 | 2365 | 'ipb_cant_unblock' => 'Error: Block ID $1 not found. It may have been unblocked already.', |
2368 | 2366 | 'ipb_blocked_as_range' => 'Error: The IP $1 is not blocked directly and cannot be unblocked. |
2369 | 2367 | It is, however, blocked as part of the range $2, which can be unblocked.', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -338,7 +338,6 @@ |
339 | 339 | * (bug 14385) "Move subpages" option no longer tries to move to invalid titles |
340 | 340 | * (bug 14386) Fix subpage namespace oddity when moving a talk page |
341 | 341 | * (bug 11771) Signup form now not shown if in read-only mode. |
342 | | -* (bug 10080) Users can now modify an existing block without unblocking first. |
343 | 342 | * (bug 12859) $wgRateLimitsExcludedGroups has been deprecated in favor of |
344 | 343 | $wgGroupPermissions[]['noratelimit']. |
345 | 344 | * (Bug 13828) Split parameter $1 of MediaWiki:Missingarticle into $1 (=title) |