public function login($userName, $password, AccessControlEvent $event)
    {
        $authCookie = $this->requestStack->getCurrentRequest()->cookies->get($this->authTokenName);

        // Remove expired tokens
        $this->getRepositoryAuthtoken()->deleteExpiredTokens();

        if ($userName !== null && $password !== null) {
            return $this->loginCheckUser($userName, $password, $event);
        } elseif ($authCookie !== null) {
            return $this->loginCheckAuthtoken($authCookie, $event);
        }

        $this->systemLogger->error('Login function called with empty username/password combination, or no authentication token.', ['event' => 'security']);
        throw new AccessControlException('Invalid login parameters.');
    }
public function login($userName, $password, AccessControlEvent $event)
    {
        $authCookie = $this->requestStack->getCurrentRequest()->cookies->get($this->authTokenName);

        // Remove expired tokens
        $this->getRepositoryAuthtoken()->deleteExpiredTokens();

        if ($userName !== null && $password !== null) {
            return $this->loginCheckUser($userName, $password, $event);
        } elseif ($authCookie !== null) {
            return $this->loginCheckAuthtoken($authCookie, $event);
        }

        $this->systemLogger->error('Login function called with empty username/password combination, or no authentication token.', ['event' => 'security']);
        throw new AccessControlException('Invalid login parameters.');
    }
public function login ( $ userName , $ password , AccessControlEvent $ event ) { $ authCookie = $ this -> requestStack -> getCurrentRequest ( ) -> cookies -> get ( $ this -> authTokenName ) ; // Remove expired tokens $ this -> getRepositoryAuthtoken ( ) -> deleteExpiredTokens ( ) ; if ( $ userName !== null && $ password !== null ) { return $ this -> loginCheckUser ( $ userName , $ password , $ event ) ; } elseif ( $ authCookie !== null ) { return $ this -> loginCheckAuthtoken ( $ authCookie , $ event ) ; } $ this -> systemLogger -> error ( 'Login function called with empty username/password combination, or no authentication token.' , [ 'event' => 'security' ] ) ; throw new AccessControlException ( 'Invalid login parameters.' ) ; }
Attempt to login a user with the given password. Accepts username or
email.

@param string             $userName
@param string             $password
@param AccessControlEvent $event

@throws AccessControlException

@return bool
Attempt to login a user with the given password . Accepts username or email .