Returns server information. If server information not in cache will make call to the dedicated server.
Try to use this with ajax calls in order to have a faster website.

@param string $login Login of the server

@return ServerInfo|null
195749
public function getServerInfo($login)
    {
        static $lockAcquired = false;

        if (isset($this->servers[$login])) {
            $cacheKey = $this->_getServerInfoCacheKey($login);
            $cacheResult = $this->serverInfoCache->fetch($cacheKey);
            if ($cacheResult) {
                return $cacheResult;
            } else if (!$lockAcquired) {
                // We don't have the lock, we need to get it before asking the dedicated.

                // Start Protected code.
                $this->semaphore->aquire($cacheKey);
                $lockAcquired = true;

                // Ask for data again, if cache filled from other instance then data from cache, if not wil do a call.
                $data = $this->getServerInfo($login);

                // End protected code.
                $lockAcquired = false;
                $this->semaphore->release($cacheKey);

                return $data;
            } else {
                // We have the lock, data not in cache get data from the server.
                $data = $this->_getServerInfo($login);
                $this->serverInfoCache->save($cacheKey, $data, $this->cacheTimeOutInfo);

                return $data;
            }
        }

        return null;
    }
125700
protected function getUserInfo(string $username)
    {
        if (!isset($this->users[$username])) {
            return null;
        }

        return $this->users[$username];
    }
906857
private function get( $key )
	{
		if ( isset($this->serverData[ $key ]) )
		{
			return $this->serverData[ $key ];
		}
		else
		{
			return null;
		}
	}
520532
public function getUser($login)
    {
        $this->checkAliasName($login);

        return $this->adapter->get(sprintf('/users/%s', $login));
    }
306742
public function check(Token $token = null, $login = '')
    {
        return !is_null($token) && !empty($login) && $this->deobfuscate($token->getValue()) == $this->sign($token->getDate(), $login, $token->getIdent());
    }
1173085
public function findByLogin($login)
    {
        $playerQuery = PlayerQuery::create();
        $player = $playerQuery->findOneByLogin($login);

        PlayerTableMap::clearInstancePool();
        return $player;
    }
1121495
public function fetchRequestMethod($server = null)
    {
        $server || $server = $this->_SERVER;

        if (isset($_POST['_method'])) {
            if (
                strtoupper($_POST['_method']) == 'PUT' ||
                strtoupper($_POST['_method']) == 'PATCH' ||
                strtoupper($_POST['_method']) == 'DELETE'
            ) {
                return strtoupper($_POST['_method']);
            }
        }

        if (php_sapi_name() == 'cli' || defined('STDIN')) {
            return 'CLI';
        }

        return $server['REQUEST_METHOD'];
    }
663206
public function loadUserByLogin( $login )
    {
        /** @var \eZ\Publish\API\Repository\Repository $repository */
        $repository = $this->getRepository();
        $userService = $repository->getUserService();

        $user = $repository->sudo(
            function() use( $login, $userService )
            {
                return $userService->loadUserByLogin( $login );
            }
        );

        return $user;
    }
480253
public static function loginUser( $login, $password, $authenticationMatch = false )
    {
        $user = self::_loginUser( $login, $password, $authenticationMatch );
        if ( $user instanceof eZUser )
        {
            $userID = $user->attribute( 'contentobject_id' );
            $paex = eZPaEx::getPaEx( $userID, true );

            if ( $paex instanceof eZPaEx && $paex->isExpired() )
            {
                self::passwordHasExpired( $user );
                return false;
            }
            else
            {
                self::loginSucceeded( $user );
                return $user;
            }
        }
        else
        {
            self::loginFailed( $user, $login );
            return false;
        }

        return $user;
    }
1276317
public function getUserByLogin(string $login)
    {
        $retval = null;

        if (strlen($login) > 0) {
            $nb_user = CNabuUser::findByLogin($this, $login);
            if ($nb_user instanceof CNabuUser && $nb_user->validateCustomer($this)) {
                $nb_user->setCustomer($this);
                $retval = $nb_user;
            }
        }

        return $retval;
    }
154306
protected function getUserEntity($userName)
    {
        if (!$userEntity = $this->getRepositoryUsers()->getUser($userName)) {
            $this->flashLogger->error(Trans::__('general.phrase.error-user-name-password-incorrect'));

            return null;
        }

        if (!$userEntity->getEnabled()) {
            $this->systemLogger->alert("Attempt to login with disabled account by '$userName'", ['event' => 'security']);
            $this->flashLogger->error(Trans::__('general.phrase.login-account-disabled'));

            return null;
        }

        return $userEntity;
    }
259068
public function getCampaignsByLogin($login)
    {
        $resource = 'campaigns/by_login/' . $login . '.json';

        $response = $this->sendRequest('GET', $this->getServiceUrl($resource));

        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        $getCampaignsResponse = new Models\GetCampaignsResponse($decodedResponseBody);
        return $getCampaignsResponse->getCampaigns();
    }
1329295
public function onPlayerAlliesChanged($login)
    {
        $playerData = $this->playerStorage->getPlayerInfo($login);
        $newPlayerData = $this->playerStorage->getPlayerInfo($login, true);

        $this->playerStorage->onPlayerAlliesChanged($playerData, $newPlayerData);
        $this->dispatch(__FUNCTION__, [$playerData, $newPlayerData]);
    }
274982
public function getUserCompanies($login)
    {
        $this->checkAliasName($login);

        return $this->adapter->get(sprintf('/users/%s/companies', $login));
    }
1206283
public function getSitesIdFromSiteUrlHavingAccess($login, $urls)
    {
        $siteUrlTable  = Common::prefixTable('site_url');
        $sqlAccessSite = Access::getSqlAccessSite('idsite');

        $db = $this->getDb();
        $ids = $db->fetchAll(
            'SELECT idsite
                FROM ' . $this->table . '
                    WHERE main_url IN ( ' . Common::getSqlStringFieldsArray($urls) . ')' .
            'AND idsite IN (' . $sqlAccessSite . ') ' .
            'UNION
                SELECT idsite
                FROM ' . $siteUrlTable . '
                    WHERE url IN ( ' . Common::getSqlStringFieldsArray($urls) . ')' .
            'AND idsite IN (' . $sqlAccessSite . ')',

            // Bind
            array_merge(    $urls,
                            array( $login ),
                            $urls,
                            array( $login )
            )
        );

        return $ids;
    }
1257852
public function last_model_is($login = null)
    {
        $this->last_model = $login instanceof User ? $login->getId() : $login;

        return $this;
    }
1036779
public function getUser(Login $login)
    {
        $user = new User();
        $user->setParams($this->params);
        $user->populate($login->getUsername(), $login->getPassword(), []);

        return $user;
    }