Index: trunk/phase3/includes/User.php |
— | — | @@ -1265,13 +1265,14 @@ |
1266 | 1266 | } |
1267 | 1267 | |
1268 | 1268 | # User/IP blocking |
1269 | | - $this->mBlock = Block::newFromTarget( $this->getName(), $ip, !$bFromSlave ); |
1270 | | - if ( $this->mBlock instanceof Block ) { |
| 1269 | + $block = Block::newFromTarget( $this->getName(), $ip, !$bFromSlave ); |
| 1270 | + if ( $block instanceof Block ) { |
1271 | 1271 | wfDebug( __METHOD__ . ": Found block.\n" ); |
1272 | | - $this->mBlockedby = $this->mBlock->getByName(); |
1273 | | - $this->mBlockreason = $this->mBlock->mReason; |
1274 | | - $this->mHideName = $this->mBlock->mHideName; |
1275 | | - $this->mAllowUsertalk = !$this->mBlock->prevents( 'editownusertalk' ); |
| 1272 | + $this->mBlock = $block; |
| 1273 | + $this->mBlockedby = $block->getByName(); |
| 1274 | + $this->mBlockreason = $block->mReason; |
| 1275 | + $this->mHideName = $block->mHideName; |
| 1276 | + $this->mAllowUsertalk = !$block->prevents( 'editownusertalk' ); |
1276 | 1277 | if ( $this->isLoggedIn() && $wgUser->getID() == $this->getID() ) { |
1277 | 1278 | $this->spreadBlock(); |
1278 | 1279 | } |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1934,7 +1934,7 @@ |
1935 | 1935 | * @deprecated since 1.18 |
1936 | 1936 | */ |
1937 | 1937 | function blockedPage() { |
1938 | | - throw new UserBlockedError( $this->getUser()->mBlock ); |
| 1938 | + throw new UserBlockedError( $this->getUser()->getBlock() ); |
1939 | 1939 | } |
1940 | 1940 | |
1941 | 1941 | /** |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1565,39 +1565,11 @@ |
1566 | 1566 | } elseif( ( $action == 'edit' || $action == 'create' ) && !$user->isBlockedFrom( $this ) ){ |
1567 | 1567 | // Don't block the user from editing their own talk page unless they've been |
1568 | 1568 | // explicitly blocked from that too. |
1569 | | - } elseif( $user->isBlocked() && $user->mBlock->prevents( $action ) !== false ) { |
1570 | | - $block = $user->mBlock; |
1571 | | - |
1572 | | - // This is from OutputPage::blockedPage |
1573 | | - // Copied at r23888 by werdna |
1574 | | - |
1575 | | - $id = $user->blockedBy(); |
1576 | | - $reason = $user->blockedFor(); |
1577 | | - if ( $reason == '' ) { |
1578 | | - $reason = wfMsg( 'blockednoreason' ); |
1579 | | - } |
1580 | | - $ip = wfGetIP(); |
1581 | | - |
1582 | | - if ( is_numeric( $id ) ) { |
1583 | | - $name = User::whoIs( $id ); |
1584 | | - } else { |
1585 | | - $name = $id; |
1586 | | - } |
1587 | | - |
1588 | | - $link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]"; |
1589 | | - $blockid = $block->getId(); |
1590 | | - $blockExpiry = $user->mBlock->mExpiry; |
1591 | | - $blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $user->mBlock->mTimestamp ), true ); |
1592 | | - if ( $blockExpiry == 'infinity' ) { |
1593 | | - $blockExpiry = wfMessage( 'infiniteblock' )->text(); |
1594 | | - } else { |
1595 | | - $blockExpiry = $wgLang->timeanddate( wfTimestamp( TS_MW, $blockExpiry ), true ); |
1596 | | - } |
1597 | | - |
1598 | | - $intended = strval( $user->mBlock->getTarget() ); |
1599 | | - |
1600 | | - $errors[] = array( ( $block->mAuto ? 'autoblockedtext' : 'blockedtext' ), $link, $reason, $ip, $name, |
1601 | | - $blockid, $blockExpiry, $intended, $blockTimestamp ); |
| 1569 | + } elseif( $user->isBlocked() && $user->getBlock()->prevents( $action ) !== false ) { |
| 1570 | + $e = new UserBlockedError( $user->getBlock() ); |
| 1571 | + $params = $e->params; |
| 1572 | + array_unshift( $params, $e->msg ); |
| 1573 | + $errors[] = $params; |
1602 | 1574 | } |
1603 | 1575 | |
1604 | 1576 | return $errors; |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -746,7 +746,7 @@ |
747 | 747 | $this->resetLoginForm( wfMsg( 'resetpass_announce' ) ); |
748 | 748 | break; |
749 | 749 | case self::CREATE_BLOCKED: |
750 | | - $this->userBlockedMessage( $wgUser->mBlock ); |
| 750 | + $this->userBlockedMessage( $wgUser->getBlock() ); |
751 | 751 | break; |
752 | 752 | case self::THROTTLED: |
753 | 753 | $this->mainLoginForm( wfMsg( 'login-throttled' ) ); |
Index: trunk/phase3/includes/specials/SpecialEmailuser.php |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | case 'badaccess': |
101 | 101 | throw new PermissionsError( 'sendemail' ); |
102 | 102 | case 'blockedemailuser': |
103 | | - throw new UserBlockedError( $this->getUser()->mBlock ); |
| 103 | + throw new UserBlockedError( $this->getUser()->getBlock() ); |
104 | 104 | case 'actionthrottledtext': |
105 | 105 | throw new ThrottledError; |
106 | 106 | case 'mailnologin': |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -825,8 +825,7 @@ |
826 | 826 | } |
827 | 827 | |
828 | 828 | if ( $this->requiresUnblock() && $user->isBlocked() ) { |
829 | | - $block = $user->mBlock; |
830 | | - throw new UserBlockedError( $block ); |
| 829 | + throw new UserBlockedError( $user->getBlock() ); |
831 | 830 | } |
832 | 831 | |
833 | 832 | return true; |
Index: trunk/phase3/includes/Action.php |
— | — | @@ -198,8 +198,7 @@ |
199 | 199 | } |
200 | 200 | |
201 | 201 | if ( $this->requiresUnblock() && $user->isBlocked() ) { |
202 | | - $block = $user->mBlock; |
203 | | - throw new UserBlockedError( $block ); |
| 202 | + throw new UserBlockedError( $user->getBlock() ); |
204 | 203 | } |
205 | 204 | } |
206 | 205 | |
Index: trunk/extensions/TorBlock/TorBlock.class.php |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | */ |
202 | 202 | public static function onGetBlockedStatus( &$user ) { |
203 | 203 | global $wgTorDisableAdminBlocks; |
204 | | - if ( $wgTorDisableAdminBlocks && self::isExitNode() && $user->mBlock && $user->mBlock->getType() != Block::TYPE_USER ) { |
| 204 | + if ( $wgTorDisableAdminBlocks && self::isExitNode() && $user->isBlocked() && $user->getBlock()->getType() != Block::TYPE_USER ) { |
205 | 205 | wfDebug( "User using Tor node. Disabling IP block as it was probably targetted at the tor node." ); |
206 | 206 | |
207 | 207 | // Node is probably blocked for being a Tor node. Remove block. |
Index: trunk/extensions/regexBlock/regexBlockCore.php |
— | — | @@ -570,16 +570,16 @@ |
571 | 571 | } |
572 | 572 | /* account creation check goes through the same hook... */ |
573 | 573 | if ( $valid['create'] == 1 ) { |
574 | | - if ( $user->mBlock ) { |
575 | | - $user->mBlock->prevents( 'createaccount', true ); |
| 574 | + if ( $user->isBlocked() ) { |
| 575 | + $user->getBlock()->prevents( 'createaccount', true ); |
576 | 576 | } |
577 | 577 | } |
578 | 578 | /* set expiry information */ |
579 | | - if ( $user->mBlock ) { |
| 579 | + if ( $user->isBlocked() ) { |
580 | 580 | # $user->mBlock->mId = $valid['blckid']; FIXME: why does this want to do this? |
581 | | - $user->mBlock->mExpiry = $valid['expire']; |
582 | | - $user->mBlock->mTimestamp = $valid['timestamp']; |
583 | | - $user->mBlock->setTarget( ($valid['ip'] == 1) ? wfGetIP() : $user->getName() ); |
| 581 | + $user->getBlock()->mExpiry = $valid['expire']; |
| 582 | + $user->getBlock()->mTimestamp = $valid['timestamp']; |
| 583 | + $user->getBlock()->setTarget( ($valid['ip'] == 1) ? wfGetIP() : $user->getName() ); |
584 | 584 | } |
585 | 585 | |
586 | 586 | $result = self::updateStats( $user, $user_ip, $blocker, $valid['match'], $valid['blckid'] ); |
Index: trunk/extensions/DynamicPageList/DPLMain.php |
— | — | @@ -2995,6 +2995,7 @@ |
2996 | 2996 | if ( isset( $iTitleMaxLen ) && ( strlen( $sTitleText ) > $iTitleMaxLen ) ) { |
2997 | 2997 | $sTitleText = substr( $sTitleText, 0, $iTitleMaxLen ) . '...'; |
2998 | 2998 | } |
| 2999 | + |
2999 | 3000 | if ( $bShowCurID && isset( $row->page_id ) ) { |
3000 | 3001 | $articleLink = '<html>' . $sk->makeKnownLinkObj( $title, htmlspecialchars( $sTitleText ), 'curid=' . $row->page_id ) . '</html>'; |
3001 | 3002 | } elseif ( !$bEscapeLinks && ( $pageNamespace == 14 || $pageNamespace == 6 ) ) { |