Rename $search to $engine to match hook docs for SpecialSearchSetupEngine
[lhc/web/wiklou.git] / includes / auth / CheckBlocksSecondaryAuthenticationProvider.php
index 7488fba..3e26097 100644 (file)
@@ -59,9 +59,11 @@ class CheckBlocksSecondaryAuthenticationProvider extends AbstractSecondaryAuthen
        }
 
        public function beginSecondaryAuthentication( $user, array $reqs ) {
+               // @TODO Partial blocks should not prevent the user from logging in.
+               //       see: https://phabricator.wikimedia.org/T208895
                if ( !$this->blockDisablesLogin ) {
                        return AuthenticationResponse::newAbstain();
-               } elseif ( $user->isBlocked() ) {
+               } elseif ( $user->getBlock() ) {
                        return AuthenticationResponse::newFail(
                                new \Message( 'login-userblocked', [ $user->getName() ] )
                        );
@@ -77,8 +79,8 @@ class CheckBlocksSecondaryAuthenticationProvider extends AbstractSecondaryAuthen
        public function testUserForCreation( $user, $autocreate, array $options = [] ) {
                $block = $user->isBlockedFromCreateAccount();
                if ( $block ) {
-                       if ( $block->mReason ) {
-                               $reason = $block->mReason;
+                       if ( $block->getReason() ) {
+                               $reason = $block->getReason();
                        } else {
                                $msg = \Message::newFromKey( 'blockednoreason' );
                                if ( !\RequestContext::getMain()->getUser()->isSafeToLoad() ) {