X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fauth%2FCheckBlocksSecondaryAuthenticationProvider.php;h=92b06a4e7ddf151013cec641b03c5b890691f215;hp=10925b50f7261452939c41368218d97c64dfbaa5;hb=04d1aa3033f40a38d721f7f0e88b5bac440d2869;hpb=644dd792caa651a8279e786fc8fc2418eefc7811 diff --git a/includes/auth/CheckBlocksSecondaryAuthenticationProvider.php b/includes/auth/CheckBlocksSecondaryAuthenticationProvider.php index 10925b50f7..92b06a4e7d 100644 --- a/includes/auth/CheckBlocksSecondaryAuthenticationProvider.php +++ b/includes/auth/CheckBlocksSecondaryAuthenticationProvider.php @@ -22,6 +22,7 @@ namespace MediaWiki\Auth; use Config; +use MediaWiki\Block\DatabaseBlock; use StatusValue; /** @@ -59,9 +60,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() ] ) ); @@ -93,7 +96,7 @@ class CheckBlocksSecondaryAuthenticationProvider extends AbstractSecondaryAuthen $block->getByName() ]; - if ( $block->getType() === \Block::TYPE_RANGE ) { + if ( $block->getType() === DatabaseBlock::TYPE_RANGE ) { $errorMessage = 'cantcreateaccount-range-text'; $errorParams[] = $this->manager->getRequest()->getIP(); } else {