@@ 1603-1611 (lines=9) @@ | ||
1600 | } |
|
1601 | ||
1602 | // Is the username creatable? |
|
1603 | if ( !User::isCreatableName( $username ) ) { |
|
1604 | $this->logger->debug( __METHOD__ . ': name "{username}" is not creatable', [ |
|
1605 | 'username' => $username, |
|
1606 | ] ); |
|
1607 | $session->set( 'AuthManager::AutoCreateBlacklist', 'noname' ); |
|
1608 | $user->setId( 0 ); |
|
1609 | $user->loadFromId(); |
|
1610 | return Status::newFatal( 'noname' ); |
|
1611 | } |
|
1612 | ||
1613 | // Is the IP user able to create accounts? |
|
1614 | $anon = new User; |
|
@@ 1630-1637 (lines=8) @@ | ||
1627 | // Avoid account creation races on double submissions |
|
1628 | $cache = \ObjectCache::getLocalClusterInstance(); |
|
1629 | $lock = $cache->getScopedLock( $cache->makeGlobalKey( 'account', md5( $username ) ) ); |
|
1630 | if ( !$lock ) { |
|
1631 | $this->logger->debug( __METHOD__ . ': Could not acquire account creation lock', [ |
|
1632 | 'user' => $username, |
|
1633 | ] ); |
|
1634 | $user->setId( 0 ); |
|
1635 | $user->loadFromId(); |
|
1636 | return Status::newFatal( 'usernameinprogress' ); |
|
1637 | } |
|
1638 | ||
1639 | // Denied by providers? |
|
1640 | $options = [ |
|
@@ 1663-1670 (lines=8) @@ | ||
1660 | } |
|
1661 | ||
1662 | $backoffKey = wfMemcKey( 'AuthManager', 'autocreate-failed', md5( $username ) ); |
|
1663 | if ( $cache->get( $backoffKey ) ) { |
|
1664 | $this->logger->debug( __METHOD__ . ': {username} denied by prior creation attempt failures', [ |
|
1665 | 'username' => $username, |
|
1666 | ] ); |
|
1667 | $user->setId( 0 ); |
|
1668 | $user->loadFromId(); |
|
1669 | return Status::newFatal( 'authmanager-autocreate-exception' ); |
|
1670 | } |
|
1671 | ||
1672 | // Checks passed, create the user... |
|
1673 | $from = isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : 'CLI'; |