Don't check anon permissions for maint scripts in autoCreateUser()
[lhc/web/wiklou.git] / includes / auth / AuthManager.php
index 9686555..f9174a7 100644 (file)
@@ -1635,7 +1635,9 @@ class AuthManager implements LoggerAwareInterface {
 
                // Is the IP user able to create accounts?
                $anon = new User;
-               if ( !$anon->isAllowedAny( 'createaccount', 'autocreateaccount' ) ) {
+               if ( $source !== self::AUTOCREATE_SOURCE_MAINT &&
+                       !$anon->isAllowedAny( 'createaccount', 'autocreateaccount' )
+               ) {
                        $this->logger->debug( __METHOD__ . ': IP lacks the ability to create or autocreate accounts', [
                                'username' => $username,
                                'ip' => $anon->getName(),