Hidden blocks should be permanent only
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 9 Jun 2008 01:15:14 +0000 (01:15 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 9 Jun 2008 01:15:14 +0000 (01:15 +0000)
includes/SpecialBlockip.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 903c116..5ea25ca 100644 (file)
@@ -347,15 +347,20 @@ class IPBlockForm {
                        // Bad expiry.
                        return array('ipb_expiry_invalid');
                }
+               
+               if( $this->BlockHideName && $expiry != 'infinity' ) {
+                       // Bad expiry.
+                       return array('ipb_expiry_temp');
+               }
 
                # Create block
                # Note: for a user block, ipb_address is only for display purposes
                $block = new Block( $this->BlockAddress, $userId, $wgUser->getId(),
                        $reasonstr, wfTimestampNow(), 0, $expiry, $this->BlockAnonOnly,
                        $this->BlockCreateAccount, $this->BlockEnableAutoblock, $this->BlockHideName,
-                       $this->BlockEmail);
+                       $this->BlockEmail );
 
-               if (wfRunHooks('BlockIp', array(&$block, &$wgUser))) {
+               if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) {
 
                        if ( !$block->insert() ) {
                                return array('ipb_already_blocked', htmlspecialchars($this->BlockAddress));
index cf36f66..156cd2e 100644 (file)
@@ -2361,6 +2361,7 @@ See the [[Special:Ipblocklist|IP block list]] for the list of currently operatio
 'block-log-flags-noemail'     => 'e-mail blocked',
 'range_block_disabled'        => 'The sysop ability to create range blocks is disabled.',
 'ipb_expiry_invalid'          => 'Expiry time invalid.',
+'ipb_expiry_temp'             => 'Hidden username blocks should be permanent.',
 'ipb_already_blocked'         => '"$1" is already blocked',
 '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 039b59d..dd83e41 100644 (file)
@@ -1616,6 +1616,7 @@ $wgMessageStructure = array(
                'block-log-flags-noemail',
                'range_block_disabled',
                'ipb_expiry_invalid',
+               'ipb_expiry_temp',
                'ipb_already_blocked',
                'ipb_modifying_block',
                'ipb_cant_unblock',