Index: branches/wmf/1.19wmf1/includes/Block.php |
— | — | @@ -33,6 +33,9 @@ |
34 | 34 | /// @var User|String |
35 | 35 | protected $target; |
36 | 36 | |
| 37 | + // @var Integer Hack for foreign blocking (CentralAuth) |
| 38 | + protected $forcedTargetID; |
| 39 | + |
37 | 40 | /// @var Block::TYPE_ constant. Can only be USER, IP or RANGE internally |
38 | 41 | protected $type; |
39 | 42 | |
— | — | @@ -72,7 +75,7 @@ |
73 | 76 | |
74 | 77 | $this->setTarget( $address ); |
75 | 78 | if ( $this->target instanceof User && $user ) { |
76 | | - $this->target->setId( $user ); // needed for foreign users |
| 79 | + $this->forcedTargetID = $user; // needed for foreign users |
77 | 80 | } |
78 | 81 | if ( $by ) { // local user |
79 | 82 | $this->setBlocker( User::newFromID( $by ) ); |
— | — | @@ -483,9 +486,15 @@ |
484 | 487 | } |
485 | 488 | $expiry = $db->encodeExpiry( $this->mExpiry ); |
486 | 489 | |
| 490 | + if ( $this->forcedTargetID ) { |
| 491 | + $uid = $this->forcedTargetID; |
| 492 | + } else { |
| 493 | + $uid = $this->target instanceof User ? $this->target->getID() : 0; |
| 494 | + } |
| 495 | + |
487 | 496 | $a = array( |
488 | 497 | 'ipb_address' => (string)$this->target, |
489 | | - 'ipb_user' => $this->target instanceof User ? $this->target->getID() : 0, |
| 498 | + 'ipb_user' => $uid, |
490 | 499 | 'ipb_by' => $this->getBy(), |
491 | 500 | 'ipb_by_text' => $this->getByName(), |
492 | 501 | 'ipb_reason' => $this->mReason, |