* (bug 13950) Allow users to watch the user/user talk pages of users they block
authorAndrew Garrett <werdna@users.mediawiki.org>
Tue, 6 May 2008 12:51:45 +0000 (12:51 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Tue, 6 May 2008 12:51:45 +0000 (12:51 +0000)
RELEASE-NOTES
includes/SpecialBlockip.php
languages/messages/MessagesEn.php

index b8a352c..c3d2c50 100644 (file)
@@ -101,6 +101,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 12542) Added hooks for expansion of Special:Listusers
 * Drop-down AJAX search suggestions (turn on $wgEnableMWSuggest) 
 * More relevant search snippets (turn on $wgAdvancedSearchHighlighting)
+* (bug 13950) Allow users to watch the user/user talk pages of users they block.
 
 === Bug fixes in 1.13 ===
 
index 61a2910..0ac6bcb 100644 (file)
@@ -62,6 +62,7 @@ class IPBlockForm {
                $this->BlockCreateAccount = $wgRequest->getBool( 'wpCreateAccount', $byDefault );
                $this->BlockEnableAutoblock = $wgRequest->getBool( 'wpEnableAutoblock', $byDefault );
                $this->BlockEmail = $wgRequest->getBool( 'wpEmailBan', false );
+               $this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false );
                # Re-check user's rights to hide names, very serious, defaults to 0
                $this->BlockHideName = ( $wgRequest->getBool( 'wpHideName', 0 ) && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0;
        }
@@ -226,13 +227,25 @@ class IPBlockForm {
                                </tr>"
                        );
                }
+               
+               # Watchlist their user page?
+               $wgOut->addHTML("
+                       <tr id='wpEnableWatchUser'>
+                               <td>&nbsp;</td>
+                               <td class='mw-input'>" .
+                                       Xml::checkLabel( wfMsg( 'ipbwatchuser' ),
+                                               'wpWatchUser', 'wpWatchUser', $this->BlockWatchUser,
+                                               array( 'tabindex' => '11' ) ) . "
+                               </td>
+                       </tr>"
+               );
 
                $wgOut->addHTML("
                        <tr>
                                <td style='padding-top: 1em'>&nbsp;</td>
                                <td  class='mw-submit' style='padding-top: 1em'>" .
                                        Xml::submitButton( wfMsg( 'ipbsubmit' ),
-                                               array( 'name' => 'wpBlock', 'tabindex' => '11' ) ) . "
+                                               array( 'name' => 'wpBlock', 'tabindex' => '12' ) ) . "
                                </td>
                        </tr>" .
                        Xml::closeElement( 'table' ) .
@@ -349,6 +362,10 @@ class IPBlockForm {
                        $this->BlockCreateAccount, $this->BlockEnableAutoblock, $this->BlockHideName,
                        $this->BlockEmail);
 
+               if ( $this->BlockWatchUser ) { 
+                       $wgUser->addWatch ( Title::makeTitle( NS_USER, $this->BlockAddress ) );
+               }
+               
                if (wfRunHooks('BlockIp', array(&$block, &$wgUser))) {
 
                        if ( !$block->insert() ) {
index 7190277..23ab312 100644 (file)
@@ -2284,6 +2284,7 @@ Fill in a specific reason below (for example, citing particular pages that were
 'ipbotheroption'              => 'other',
 'ipbotherreason'              => 'Other/additional reason:',
 'ipbhidename'                 => 'Hide username from the block log, active block list and user list',
+'ipbwatchuser'                => "Watch this user's user and talk pages",
 'badipaddress'                => 'Invalid IP address',
 'blockipsuccesssub'           => 'Block succeeded',
 'blockipsuccesstext'          => '[[Special:Contributions/$1|$1]] has been blocked.<br />