X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fauth%2FAuthManager.php;h=e03c5901bfd038263064e5209ef33257979d9c01;hb=e5ef0fd0c6607dd34f6dee69d716b159662a0a34;hp=0c6218e6d42d606526801f36e379f3992e1a216f;hpb=ed51a25562bdc153f63a7b8e37eb176c3eeee7bb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php index 0c6218e6d4..e03c5901bf 100644 --- a/includes/auth/AuthManager.php +++ b/includes/auth/AuthManager.php @@ -24,6 +24,7 @@ namespace MediaWiki\Auth; use Config; +use MediaWiki\Block\DatabaseBlock; use MediaWiki\MediaWikiServices; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; @@ -1010,7 +1011,7 @@ class AuthManager implements LoggerAwareInterface { $block->getByName() ]; - if ( $block->getType() === \Block::TYPE_RANGE ) { + if ( $block->getType() === DatabaseBlock::TYPE_RANGE ) { $errorMessage = 'cantcreateaccount-range-text'; $errorParams[] = $this->getRequest()->getIP(); } else { @@ -1021,7 +1022,10 @@ class AuthManager implements LoggerAwareInterface { } $ip = $this->getRequest()->getIP(); - if ( $creator->isDnsBlacklisted( $ip, true /* check $wgProxyWhitelist */ ) ) { + if ( + MediaWikiServices::getInstance()->getBlockManager() + ->isDnsBlacklisted( $ip, true /* check $wgProxyWhitelist */ ) + ) { return Status::newFatal( 'sorbs_create_account_reason' ); } @@ -1423,7 +1427,7 @@ class AuthManager implements LoggerAwareInterface { // @codeCoverageIgnoreEnd } $this->setDefaultUserOptions( $user, $creator->isAnon() ); - \Hooks::run( 'LocalUserCreated', [ $user, false ] ); + \Hooks::runWithoutAbort( 'LocalUserCreated', [ $user, false ] ); $user->saveSettings(); $state['userid'] = $user->getId(); @@ -2101,10 +2105,8 @@ class AuthManager implements LoggerAwareInterface { $id = $req->getUniqueId(); // If a required request if from a Primary, mark it as "primary-required" instead - if ( $isPrimary ) { - if ( $req->required ) { - $req->required = AuthenticationRequest::PRIMARY_REQUIRED; - } + if ( $isPrimary && $req->required ) { + $req->required = AuthenticationRequest::PRIMARY_REQUIRED; } if (