r61735 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61734‎ | r61735 | r61736 >
Date:01:16, 31 January 2010
Author:vasilievvv
Status:ok
Tags:
Comment:
Modify IPBlockForm::(un)suppressUserName so it can be used on a different database.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialBlockip.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialBlockip.php
@@ -539,19 +539,20 @@
540540 }
541541 }
542542
543 - public static function suppressUserName( $name, $userId ) {
 543+ public static function suppressUserName( $name, $userId, $dbw = null ) {
544544 $op = '|'; // bitwise OR
545 - return self::setUsernameBitfields( $name, $userId, $op );
 545+ return self::setUsernameBitfields( $name, $userId, $op, $dbw );
546546 }
547547
548 - public static function unsuppressUserName( $name, $userId ) {
 548+ public static function unsuppressUserName( $name, $userId, $dbw = null ) {
549549 $op = '&'; // bitwise AND
550 - return self::setUsernameBitfields( $name, $userId, $op );
 550+ return self::setUsernameBitfields( $name, $userId, $op, $dbw );
551551 }
552552
553 - private static function setUsernameBitfields( $name, $userId, $op ) {
 553+ private static function setUsernameBitfields( $name, $userId, $op, $dbw ) {
554554 if( $op !== '|' && $op !== '&' ) return false; // sanity check
555 - $dbw = wfGetDB( DB_MASTER );
 555+ if( !$dbw )
 556+ $dbw = wfGetDB( DB_MASTER );
556557 $delUser = Revision::DELETED_USER | Revision::DELETED_RESTRICTED;
557558 $delAction = LogPage::DELETED_ACTION | Revision::DELETED_RESTRICTED;
558559 # Normalize user name

Status & tagging log