49 if ( !$userId || ( $op !==
'|' && $op !==
'&' ) ) {
56 # To suppress, we OR the current bitfields with RevisionRecord::DELETED_USER
57 # to put a 1 in the username *_deleted bit. To unsuppress we AND the
58 # current bitfields with the inverse of RevisionRecord::DELETED_USER. The
59 # username bit is made to 0 (x & 0 = 0), while others are unchanged (x & 1 = x).
60 # The same goes for the sysop-restricted *_deleted bit.
61 $delUser = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;
64 $delUser = $dbw->bitNot( $delUser );
65 $delAction = $dbw->bitNot( $delAction );
69 $userTitle = Title::makeTitleSafe(
NS_USER, $name );
70 $userDbKey = $userTitle->getDBkey();
72 $actorId = $dbw->selectField(
'actor',
'actor_id', [
'actor_name' => $name ], __METHOD__ );
74 # Hide name from live edits
75 # This query depends on the actor migration read stage, not the
76 # write stage, because the stage determines how we find the rows to
77 # delete. The write stage determines whether or not to write to
78 # rev_actor and revision_actor_temp which is not relevant here.
80 $ids = $dbw->selectFieldValues(
81 'revision_actor_temp',
'revactor_rev', [
'revactor_actor' => $actorId ], __METHOD__
86 [ self::buildSetBitDeletedField(
'rev_deleted', $op, $delUser, $dbw ) ],
94 [ self::buildSetBitDeletedField(
'rev_deleted', $op, $delUser, $dbw ) ],
95 [
'rev_actor' => $actorId ],
100 # Hide name from deleted edits
103 [ self::buildSetBitDeletedField(
'ar_deleted', $op, $delUser, $dbw ) ],
104 [
'ar_actor' => $actorId ],
108 # Hide name from logs
111 [ self::buildSetBitDeletedField(
'log_deleted', $op, $delUser, $dbw ) ],
112 [
'log_actor' => $actorId,
'log_type != ' . $dbw->addQuotes(
'suppress' ) ],
119 [ self::buildSetBitDeletedField(
'rc_deleted', $op, $delUser, $dbw ) ],
120 [
'rc_actor' => $actorId ],
124 # Hide name from live images
127 [ self::buildSetBitDeletedField(
'oi_deleted', $op, $delUser, $dbw ) ],
128 [
'oi_actor' => $actorId ],
132 # Hide name from deleted images
135 [ self::buildSetBitDeletedField(
'fa_deleted', $op, $delUser, $dbw ) ],
136 [
'fa_actor' => $actorId ],
141 # Hide log entries pointing to the user page
144 [ self::buildSetBitDeletedField(
'log_deleted', $op, $delAction, $dbw ) ],
145 [
'log_namespace' =>
NS_USER,
'log_title' => $userDbKey,
146 'log_type != ' . $dbw->addQuotes(
'suppress' ) ],
150 # Hide RC entries pointing to the user page
153 [ self::buildSetBitDeletedField(
'rc_deleted', $op, $delAction, $dbw ) ],
154 [
'rc_namespace' =>
NS_USER,
'rc_title' => $userDbKey,
'rc_logid > 0' ],