Index: trunk/phase3/maintenance/language/messages.inc
===================================================================
--- trunk/phase3/maintenance/language/messages.inc (revision 42842)
+++ trunk/phase3/maintenance/language/messages.inc (revision 42843)
@@ -1745,6 +1745,7 @@
'ipbhidename',
'ipbwatchuser',
'ipballowusertalk',
+ 'ipb-change-block',
'badipaddress',
'blockipsuccesssub',
'blockipsuccesstext',
@@ -1784,6 +1785,7 @@
'blocklogpage',
'blocklog-fulllog',
'blocklogentry',
+ 'reblock-logentry',
'blocklogtext',
'unblocklogentry',
'block-log-flags-anononly',
@@ -1796,6 +1798,7 @@
'ipb_expiry_invalid',
'ipb_expiry_temp',
'ipb_already_blocked',
+ 'ipb-needreblock',
'ipb_cant_unblock',
'ipb_blocked_as_range',
'ip_range_invalid',
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php (revision 42842)
+++ trunk/phase3/includes/DefaultSettings.php (revision 42843)
@@ -2762,6 +2762,7 @@
$wgLogActions = array(
'block/block' => 'blocklogentry',
'block/unblock' => 'unblocklogentry',
+ 'block/reblock' => 'reblock-logentry',
'protect/protect' => 'protectedarticle',
'protect/modify' => 'modifiedarticleprotection',
'protect/unprotect' => 'unprotectedarticle',
Index: trunk/phase3/includes/specials/SpecialBlockip.php
===================================================================
--- trunk/phase3/includes/specials/SpecialBlockip.php (revision 42842)
+++ trunk/phase3/includes/specials/SpecialBlockip.php (revision 42843)
@@ -67,6 +67,7 @@
# Re-check user's rights to hide names, very serious, defaults to 0
$this->BlockHideName = ( $wgRequest->getBool( 'wpHideName', 0 ) && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0;
$this->BlockAllowUsertalk = ( $wgRequest->getBool( 'wpAllowUsertalk', $byDefault ) && $wgBlockAllowsUTEdit );
+ $this->BlockReblock = $wgRequest->getBool( 'wpChangeBlock', false );
}
function showForm( $err ) {
@@ -86,10 +87,19 @@
$mIpbreason = Xml::label( wfMsg( 'ipbotherreason' ), 'mw-bi-reason' );
$titleObj = SpecialPage::getTitleFor( 'Blockip' );
-
- if ( "" != $err ) {
+
+ $alreadyBlocked = false;
+ if ( $err && $err[0] != 'ipb_already_blocked' ) {
+ $key = array_shift($err);
+ $msg = wfMsgReal($key, $err);
$wgOut->setSubtitle( wfMsgHtml( 'formerror' ) );
- $wgOut->addHTML( Xml::tags( 'p', array( 'class' => 'error' ), $err ) );
+ $wgOut->addHTML( Xml::tags( 'p', array( 'class' => 'error' ), $msg ) );
+ } elseif ( $this->BlockAddress ) {
+ $currentBlock = Block::newFromDB( $this->BlockAddress );
+ if ( !is_null($currentBlock) && !$currentBlock->mAuto && !($currentBlock->mRangeStart && $currentBlock->mAddress != $this->BlockAddress) ) {
+ $wgOut->addWikiMsg( 'ipb-needreblock', $this->BlockAddress );
+ $alreadyBlocked = true;
+ }
}
$scBlockExpiryOptions = wfMsgForContent( 'ipboptions' );
@@ -253,6 +263,18 @@
</tr>"
);
}
+ if ( $alreadyBlocked ) {
+ $wgOut->addHTML("
+ <tr id='wpChangeBlockRow'>
+ <td> </td>
+ <td class='mw-input'>" .
+ Xml::checkLabel( wfMsg( 'ipb-change-block' ),
+ 'wpChangeBlock', 'wpChangeBlock', $this->BlockReblock,
+ array( 'tabindex' => '13' ) ) . "
+ </td>
+ </tr>"
+ );
+ }
$wgOut->addHTML("
<tr>
@@ -379,9 +401,18 @@
if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) {
if ( !$block->insert() ) {
- return array('ipb_already_blocked', htmlspecialchars($this->BlockAddress));
+ if ( !$this->BlockReblock ) {
+ return array( 'ipb_already_blocked' );
+ } else {
+ # This returns direct blocks before autoblocks/rangeblocks, since we should be sure the user is blocked by now it should work for our purposes
+ $currentBlock = Block::newFromDB( $this->BlockAddress );
+ $currentBlock->delete();
+ $block->insert();
+ $log_action = 'reblock';
+ }
+ } else {
+ $log_action = 'block';
}
-
wfRunHooks('BlockIpComplete', array($block, $wgUser));
if ( $this->BlockWatchUser ) {
@@ -396,7 +427,7 @@
# Make log entry, if the name is hidden, put it in the oversight log
$log_type = ($this->BlockHideName) ? 'suppress' : 'block';
$log = new LogPage( $log_type );
- $log->addEntry( 'block', Title::makeTitle( NS_USER, $this->BlockAddress ),
+ $log->addEntry( $log_action, Title::makeTitle( NS_USER, $this->BlockAddress ),
$reasonstr, $logParams );
# Report to the user
@@ -420,8 +451,7 @@
urlencode( $this->BlockAddress ) ) );
return;
}
- $key = array_shift($retval);
- $this->showForm(wfMsgReal($key, $retval));
+ $this->showForm( $retval );
}
function showSuccess() {
Index: trunk/phase3/includes/LogPage.php
===================================================================
--- trunk/phase3/includes/LogPage.php (revision 42842)
+++ trunk/phase3/includes/LogPage.php (revision 42843)
@@ -196,7 +196,7 @@
} else {
$details = '';
array_unshift( $params, $titleLink );
- if ( $key == 'block/block' || $key == 'suppress/block' ) {
+ if ( $key == 'block/block' || $key == 'suppress/block' || $key == 'block/reblock' ) {
if ( $skin ) {
$params[1] = '<span title="' . htmlspecialchars( $params[1] ). '">' .
$wgLang->translateBlockExpiry( $params[1] ) . '</span>';
Index: trunk/phase3/languages/messages/MessagesEn.php
===================================================================
--- trunk/phase3/languages/messages/MessagesEn.php (revision 42842)
+++ trunk/phase3/languages/messages/MessagesEn.php (revision 42843)
@@ -2552,6 +2552,7 @@
'ipbhidename' => 'Hide username from the block log, active block list and user list',
'ipbwatchuser' => "Watch this user's user and talk pages",
'ipballowusertalk' => 'Allow this user to edit own talk page while blocked',
+'ipb-change-block' => 'Re-block the user with these settings',
'badipaddress' => 'Invalid IP address',
'blockipsuccesssub' => 'Block succeeded',
'blockipsuccesstext' => '[[Special:Contributions/$1|$1]] has been blocked.<br />
@@ -2593,6 +2594,7 @@
'blocklogpage' => 'Block log',
'blocklog-fulllog' => 'Full block log',
'blocklogentry' => 'blocked [[$1]] with an expiry time of $2 $3',
+'reblock-logentry' => 'changed block settings for [[$1]] with an expiry time of $2 $3',
'blocklogtext' => 'This is a log of user blocking and unblocking actions.
Automatically blocked IP addresses are not listed.
See the [[Special:IPBlockList|IP block list]] for the list of currently operational bans and blocks.',
@@ -2607,6 +2609,8 @@
'ipb_expiry_invalid' => 'Expiry time invalid.',
'ipb_expiry_temp' => 'Hidden username blocks must be permanent.',
'ipb_already_blocked' => '"$1" is already blocked',
+'ipb-needreblock' => '== Already blocked ==
+$1 is already blocked. Do you want to change the settings?',
'ipb_cant_unblock' => 'Error: Block ID $1 not found.
It may have been unblocked already.',
'ipb_blocked_as_range' => 'Error: The IP $1 is not blocked directly and cannot be unblocked.
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES (revision 42842)
+++ trunk/phase3/RELEASE-NOTES (revision 42843)
@@ -179,6 +179,9 @@
* Make search matches bold only, not red as well
* Added 'UserRights::showEditUserGroupsForm' hook to allow extensions to alter
the groups that the user can be added to or removed from in Special:UserRights
+* (bug 10080) Blocks can be modified without unblocking first
+* (bug 15820) Special:BlockIP shows a notice if the user being blocked is already
+ directly blocked
=== Bug fixes in 1.14 ===