From aac175d10b72e090403e83cc4f5008e0e495bcb9 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 14 Nov 2008 07:44:14 +0000 Subject: [PATCH] (bug 16305) Allow optional replacement of user talk page --- includes/specials/SpecialBlockip.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index f9019a70dd..7b96c40c1b 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -575,10 +575,11 @@ class IPBlockForm { * Block a list of selected users * @param array $users * @param string $reason - * @param string $tag + * @param string $tag replaces user pages + * @param string $talkTag replaces user talk pages * @returns array, list of html-safe usernames */ - public static function doMassUserBlock( $users, $reason = '', $tag = '' ) { + public static function doMassUserBlock( $users, $reason = '', $tag = '', $talkTag = '' ) { global $wgUser; $counter = $blockSize = 0; $safeUsers = array(); @@ -597,9 +598,11 @@ class IPBlockForm { if( is_null($u) || (!$u->getId() && !IP::isIPAddress( $u->getName() )) ) { continue; } - $usertitle = Title::makeTitle( NS_USER, $u->getName() ); - $userpage = new Article( $usertitle ); - $safeUsers[] = '[[' . $usertitle->getPrefixedText() . '|' . $usertitle->getText() . ']]'; + $userTitle = $u->getUserPage(); + $userTalkTitle = $u->getTalkPage(); + $userpage = new Article( $userTitle ); + $usertalk = new Article( $userTalkTitle ); + $safeUsers[] = '[[' . $userTitle->getPrefixedText() . '|' . $userTitle->getText() . ']]'; $expirestr = $u->getId() ? 'indefinite' : '1 week'; $expiry = Block::parseExpiryInput( $expirestr ); $anonOnly = IP::isIPAddress( $u->getName() ) ? 1 : 0; @@ -628,12 +631,15 @@ class IPBlockForm { } $logParams[] = 'nocreate'; # Add log entry - $log->addEntry( 'block', $usertitle, $reason, $logParams ); + $log->addEntry( 'block', $userTitle, $reason, $logParams ); } # Tag userpage! (check length to avoid mistakes) if( strlen($tag) > 2 ) { $userpage->doEdit( $tag, $reason, EDIT_MINOR ); } + if( strlen($talkTag) > 2 ) { + $usertalk->doEdit( $talkTag, $reason, EDIT_MINOR ); + } } return $safeUsers; } -- 2.20.1