r35960 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r35959‎ | r35960 | r35961 >
Date:00:46, 6 June 2008
Author:brion
Status:old
Tags:
Comment:
Revert r35901 -- UI regressions (ipb_already_blocked appears to have changed format, spewing giant red HTML all over everything)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialBlockip.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialBlockip.php
@@ -47,32 +47,10 @@
4848 # var $BlockEmail;
4949
5050 function IPBlockForm( $par ) {
51 - global $wgRequest, $wgUser, $wgLang;
 51+ global $wgRequest, $wgUser;
5252
5353 $this->BlockAddress = $wgRequest->getVal( 'wpBlockAddress', $wgRequest->getVal( 'ip', $par ) );
5454 $this->BlockAddress = strtr( $this->BlockAddress, '_', ' ' );
55 - $this->AlreadyBlocked = false;
56 -
57 - if( $this->BlockAddress && !$wgRequest->wasPosted() ){
58 - $this->mBlock = new Block();
59 - if( $this->mBlock->load($this->BlockAddress) ) {
60 - $this->AlreadyBlocked = true;
61 - $this->BlockReason = wfMsgForContent( 'ipb_modifying_block' );
62 - $this->BlockReasonList = $wgRequest->getText( 'wpBlockReasonList' );
63 - $this->BlockExpiry = wfMsg('ipbotheroption');
64 - $this->BlockOther = $wgLang->timeanddate( $this->mBlock->mExpiry );
65 - $this->BlockAnonOnly = $wgRequest->getBool( 'wpAnonOnly', true );
66 - $this->BlockCreateAccount = $wgRequest->getBool( 'wpCreateAccount', true );
67 - $this->BlockEnableAutoblock = $wgRequest->getBool( 'wpEnableAutoblock', true );
68 - $this->BlockEmail = $wgRequest->getBool( 'wpEmailBan', false );
69 - $this->BlockEmail = $this->mBlock->mBlockEmail;
70 - $this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false );
71 - # Re-check user's rights to hide names, very serious, defaults to 0
72 - $this->BlockHideName = ( $this->mBlock->mHideName && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0;
73 - return true;
74 - }
75 - }
76 -
7755 $this->BlockReason = $wgRequest->getText( 'wpBlockReason' );
7856 $this->BlockReasonList = $wgRequest->getText( 'wpBlockReasonList' );
7957 $this->BlockExpiry = $wgRequest->getVal( 'wpBlockExpiry', wfMsg('ipbotheroption') );
@@ -133,10 +111,6 @@
134112 wfMsgForContent( 'ipbreasonotherlist' ), '', 'wpBlockDropDown', 4 );
135113
136114 global $wgStylePath, $wgStyleVersion;
137 - if( $this->AlreadyBlocked ) {
138 - $wgOut->addHTML( Xml::element( 'p', array ( 'class' => 'error' ),
139 - wfMsg( 'ipb_already_blocked', $this->BlockAddress ) ) );
140 - }
141115 $wgOut->addHTML(
142116 Xml::tags( 'script', array( 'type' => 'text/javascript', 'src' => "$wgStylePath/common/block.js?$wgStyleVersion" ), '' ) .
143117 Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( "action=submit" ), 'id' => 'blockip' ) ) .
@@ -384,10 +358,7 @@
385359 if (wfRunHooks('BlockIp', array(&$block, &$wgUser))) {
386360
387361 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));
392363 }
393364
394365 wfRunHooks('BlockIpComplete', array($block, $wgUser));
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2360,9 +2360,7 @@
23612361 'block-log-flags-noemail' => 'e-mail blocked',
23622362 'range_block_disabled' => 'The sysop ability to create range blocks is disabled.',
23632363 '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',
23672365 'ipb_cant_unblock' => 'Error: Block ID $1 not found. It may have been unblocked already.',
23682366 'ipb_blocked_as_range' => 'Error: The IP $1 is not blocked directly and cannot be unblocked.
23692367 It is, however, blocked as part of the range $2, which can be unblocked.',
Index: trunk/phase3/RELEASE-NOTES
@@ -338,7 +338,6 @@
339339 * (bug 14385) "Move subpages" option no longer tries to move to invalid titles
340340 * (bug 14386) Fix subpage namespace oddity when moving a talk page
341341 * (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.
343342 * (bug 12859) $wgRateLimitsExcludedGroups has been deprecated in favor of
344343 $wgGroupPermissions[]['noratelimit'].
345344 * (Bug 13828) Split parameter $1 of MediaWiki:Missingarticle into $1 (=title)

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r35901Bug 10080 - Sysops can now modify a block without unblocking first. Patch by ...demon00:11, 5 June 2008

Status & tagging log