Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / includes / auth / AuthManager.php
index 0c6218e..e03c590 100644 (file)
@@ -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 (