X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fauth%2FCheckBlocksSecondaryAuthenticationProvider.php;h=92b06a4e7ddf151013cec641b03c5b890691f215;hb=eb70451cec6409526c8feaedf55700f51e10ffe7;hp=10925b50f7261452939c41368218d97c64dfbaa5;hpb=1a62e51a00321eb6674e27cdff57c683703a5579;p=lhc%2Fweb%2Fwiklou.git 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 {