Neos.Neos/Classes/Domain/Service/UserService.php
public function getUser($username, $authenticationProviderName = null)
    {
        $authenticationProviderName = $authenticationProviderName ?: $this->defaultAuthenticationProviderName;
        $cacheIdentifier = $authenticationProviderName . '~' . $username;

        if (array_key_exists($cacheIdentifier, $this->runtimeUserCache)) {
            $userIdentifier = $this->runtimeUserCache[$cacheIdentifier];
            return $this->partyRepository->findByIdentifier($userIdentifier);
        }

        $user = $this->findUserForAccount($username, $authenticationProviderName);

        if ($user instanceof AbstractParty) {
            $userIdentifier = $this->persistenceManager->getIdentifierByObject($user);
        }

        if (isset($userIdentifier) && (string)$userIdentifier !== '') {
            $this->runtimeUserCache[$cacheIdentifier] = $userIdentifier;
            return $this->partyRepository->findByIdentifier($userIdentifier);
        }

        return null;
    }
public function getUser($username, $authenticationProviderName = null)
    {
        $authenticationProviderName = $authenticationProviderName ?: $this->defaultAuthenticationProviderName;
        $cacheIdentifier = $authenticationProviderName . '~' . $username;

        if (array_key_exists($cacheIdentifier, $this->runtimeUserCache)) {
            $userIdentifier = $this->runtimeUserCache[$cacheIdentifier];
            return $this->partyRepository->findByIdentifier($userIdentifier);
        }

        $user = $this->findUserForAccount($username, $authenticationProviderName);

        if ($user instanceof AbstractParty) {
            $userIdentifier = $this->persistenceManager->getIdentifierByObject($user);
        }

        if (isset($userIdentifier) && (string)$userIdentifier !== '') {
            $this->runtimeUserCache[$cacheIdentifier] = $userIdentifier;
            return $this->partyRepository->findByIdentifier($userIdentifier);
        }

        return null;
    }
public function getUser ( $ username , $ authenticationProviderName = null ) { $ authenticationProviderName = $ authenticationProviderName ? : $ this -> defaultAuthenticationProviderName ; $ cacheIdentifier = $ authenticationProviderName . '~' . $ username ; if ( array_key_exists ( $ cacheIdentifier , $ this -> runtimeUserCache ) ) { $ userIdentifier = $ this -> runtimeUserCache [ $ cacheIdentifier ] ; return $ this -> partyRepository -> findByIdentifier ( $ userIdentifier ) ; } $ user = $ this -> findUserForAccount ( $ username , $ authenticationProviderName ) ; if ( $ user instanceof AbstractParty ) { $ userIdentifier = $ this -> persistenceManager -> getIdentifierByObject ( $ user ) ; } if ( isset ( $ userIdentifier ) && ( string ) $ userIdentifier !== '' ) { $ this -> runtimeUserCache [ $ cacheIdentifier ] = $ userIdentifier ; return $ this -> partyRepository -> findByIdentifier ( $ userIdentifier ) ; } return null ; }
Retrieves an existing user by the given username

@param string $username The username
@param string $authenticationProviderName Name of the authentication provider to use. Example: "Neos.Neos:Backend"
@return User The user, or null if the user does not exist
@throws Exception
@api
Retrieves an existing user by the given username