(bug 17236) Suppress 'watch user page link' for IP range blocks. Patch contributed...
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Mon, 2 Feb 2009 16:21:43 +0000 (16:21 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Mon, 2 Feb 2009 16:21:43 +0000 (16:21 +0000)
RELEASE-NOTES
includes/specials/SpecialBlockip.php
skins/common/block.js

index 1df6f30..ee7d10a 100644 (file)
@@ -79,6 +79,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Styled #mw-data-after-content in cologneblue.css to match the rest of the font (bug 17110)
 * (bug 7556) Time zone names in signatures lack i18n
 * (bug 3311) Automatic category redirects
+* (bug 17236) Suppress 'watch user page link' for IP range blocks
 
 === Bug fixes in 1.15 ===
 * (bug 16968) Special:Upload no longer throws useless warnings.
index 6b60cd1..da51d90 100644 (file)
@@ -428,7 +428,9 @@ class IPBlockForm {
                        }
                        wfRunHooks('BlockIpComplete', array($block, $wgUser));
 
-                       if ( $this->BlockWatchUser ) { 
+                       if ( $this->BlockWatchUser &&
+                               # Only show watch link when this is no range block
+                               $block->mRangeStart == $block->mRangeEnd) {
                                $wgUser->addWatch ( Title::makeTitle( NS_USER, $this->BlockAddress ) );
                        }
                        
index 6f7be0c..90211ef 100644 (file)
@@ -31,6 +31,7 @@ function updateBlockOptions() {
        var addy = target.value;
        var isEmpty = addy.match(/^\s*$/);
        var isIp = addy.match(/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|:(:[0-9A-Fa-f]{1,4}){1,7}|[0-9A-Fa-f]{1,4}(:{1,2}[0-9A-Fa-f]{1,4}|::$){1,7})(\/\d+)?$/);
+       var isIpRange = isIp && addy.match(/\/\d+$/);
 
        var anonymousRow = document.getElementById('wpAnonOnlyRow');
        if( anonymousRow ) {
@@ -51,4 +52,9 @@ function updateBlockOptions() {
        if( hideuserRow ) {
                hideuserRow.style.display = isIp && !isEmpty ? 'none' : '';
        }
+
+       var watchuserRow = document.getElementById('wpEnableWatchUser');
+       if( watchuserRow ) {
+               watchuserRow.style.display = isIpRange && !isEmpty ? 'none' : '';
+       }
 }