r48886 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48885‎ | r48886 | r48887 >
Date:16:46, 26 March 2009
Author:aaron
Status:ok
Tags:
Comment:
Hide log items with said user as the target as well
Modified paths:
  • /trunk/phase3/includes/specials/SpecialBlockip.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialBlockip.php
@@ -497,16 +497,17 @@
498498 }
499499
500500 private function setUsernameBitfields( $name, $userId, $op ) {
501 - if( $op !== '|' && $op !== '&' )
502 - return false; // sanity check
 501+ if( $op !== '|' && $op !== '&' ) return false; // sanity check
503502 $dbw = wfGetDB( DB_MASTER );
504503 $delUser = Revision::DELETED_USER | Revision::DELETED_RESTRICTED;
 504+ $delAction = LogPage::DELETED_ACTION | Revision::DELETED_RESTRICTED;
505505 # To suppress, we OR the current bitfields with Revision::DELETED_USER
506506 # to put a 1 in the username *_deleted bit. To unsuppress we AND the
507507 # current bitfields with the inverse of Revision::DELETED_USER. The
508508 # username bit is made to 0 (x & 0 = 0), while others are unchanged (x & 1 = x).
509509 # The same goes for the sysop-restricted *_deleted bit.
510510 if( $op == '&' ) $delUser = "~{$delUser}";
 511+ if( $op == '&' ) $delAction = "~{$delAction}";
511512 # Hide name from live edits
512513 $dbw->update( 'revision', array("rev_deleted = rev_deleted $op $delUser"),
513514 array('rev_user' => $userId), __METHOD__ );
@@ -516,6 +517,8 @@
517518 # Hide name from logs
518519 $dbw->update( 'logging', array("log_deleted = log_deleted $op $delUser"),
519520 array('log_user' => $userId), __METHOD__ );
 521+ $dbw->update( 'logging', array("log_deleted = log_deleted $op $delAction"),
 522+ array('log_namespace' => NS_USER, 'log_title' => $name), __METHOD__ );
520523 # Hide name from RC
521524 $dbw->update( 'recentchanges', array("rc_deleted = rc_deleted $op $delUser"),
522525 array('rc_user_text' => $name), __METHOD__ );

Follow-up revisions

RevisionCommit summaryAuthorDate
r48892Fix r48886: make sure title is normalized for queryaaron18:53, 26 March 2009
r50162Backports for the hide user feature:...tstarling07:58, 4 May 2009

Status & tagging log