From ebfc767db36e6d75361a2bb90f966bb74b46cbf8 Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Sun, 31 Jan 2010 01:16:55 +0000 Subject: [PATCH] Modify IPBlockForm::(un)suppressUserName so it can be used on a different database. --- includes/specials/SpecialBlockip.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index ceef42db22..16720dd131 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -539,19 +539,20 @@ class IPBlockForm { } } - public static function suppressUserName( $name, $userId ) { + public static function suppressUserName( $name, $userId, $dbw = null ) { $op = '|'; // bitwise OR - return self::setUsernameBitfields( $name, $userId, $op ); + return self::setUsernameBitfields( $name, $userId, $op, $dbw ); } - public static function unsuppressUserName( $name, $userId ) { + public static function unsuppressUserName( $name, $userId, $dbw = null ) { $op = '&'; // bitwise AND - return self::setUsernameBitfields( $name, $userId, $op ); + return self::setUsernameBitfields( $name, $userId, $op, $dbw ); } - private static function setUsernameBitfields( $name, $userId, $op ) { + private static function setUsernameBitfields( $name, $userId, $op, $dbw ) { if( $op !== '|' && $op !== '&' ) return false; // sanity check - $dbw = wfGetDB( DB_MASTER ); + if( !$dbw ) + $dbw = wfGetDB( DB_MASTER ); $delUser = Revision::DELETED_USER | Revision::DELETED_RESTRICTED; $delAction = LogPage::DELETED_ACTION | Revision::DELETED_RESTRICTED; # Normalize user name -- 2.20.1