Remove DatabaseBlock::forcedUserId feature

This used to be needed when we couldn't pass a cross-wiki
user target correctly. Now that UserIdentity is cross-wiki-aware,
we can.

Bug: T283642
Depends-On: I6f57357d3a73e753e018986e6af6245c29468875
Depends-On: Ie48ee3fcbf3fa7a285e80caf627be0b726b757c2
Change-Id: I3c21e55022c5fb316a390027f7c28211b29c3d62
This commit is contained in:
Petr Pchelko 2021-05-25 15:37:17 -07:00
parent 2b5a3f7d93
commit a3b4881f6f
2 changed files with 1 additions and 22 deletions

View file

@ -68,9 +68,6 @@ class DatabaseBlock extends AbstractBlock {
/** @var bool */
private $mFromPrimary;
/** @var int Hack for foreign blocking (CentralAuth) */
private $forcedTargetID;
/** @var bool */
private $isAutoblocking;
@ -120,11 +117,6 @@ class DatabaseBlock extends AbstractBlock {
$options += $defaults;
if ( $this->target instanceof UserIdentity && $options['user'] ) {
# Needed for foreign users
$this->forcedTargetID = $options['user'];
}
if ( $options['by'] ) {
if ( $options['by'] instanceof UserIdentity ) {
$this->setBlocker( $options['by'] );
@ -1323,16 +1315,6 @@ class DatabaseBlock extends AbstractBlock {
return $this->blocker;
}
/**
* Get the forcedTargetID if set
*
* @internal
* @return ?int
*/
public function getForcedTargetID() : ?int {
return $this->forcedTargetID;
}
/**
* Set the user who implemented (or will implement) this block
*

View file

@ -380,10 +380,7 @@ class DatabaseBlockStore {
) : array {
$expiry = $dbw->encodeExpiry( $block->getExpiry() );
$forcedTargetId = $block->getForcedTargetID();
if ( $forcedTargetId ) {
$userId = $forcedTargetId;
} elseif ( $block->getTargetUserIdentity() ) {
if ( $block->getTargetUserIdentity() ) {
$userId = $block->getTargetUserIdentity()->getId();
} else {
$userId = 0;