public function login()
    {
        $result = $this->adapter->getResult();
        if ($result === self::PHAVOUR_AUTH_SERVICE_SUCCESS) {
            $auth = Auth::getInstance();
            $auth->login($this->adapter->getIdentity());
            $auth->setRoles($this->adapter->getRoles());

            return true;

        } elseif ($result === self::PHAVOUR_AUTH_SERVICE_INVALID) {
            throw new InvalidCredentialsException('Invalid credentials exception');
        }

        throw new UnrecognisedAuthenticationResultException('Expected 1 or 2');
    }
public function login()
    {
        $result = $this->adapter->getResult();
        if ($result === self::PHAVOUR_AUTH_SERVICE_SUCCESS) {
            $auth = Auth::getInstance();
            $auth->login($this->adapter->getIdentity());
            $auth->setRoles($this->adapter->getRoles());

            return true;

        } elseif ($result === self::PHAVOUR_AUTH_SERVICE_INVALID) {
            throw new InvalidCredentialsException('Invalid credentials exception');
        }

        throw new UnrecognisedAuthenticationResultException('Expected 1 or 2');
    }
public function login ( ) { $ result = $ this -> adapter -> getResult ( ) ; if ( $ result === self :: PHAVOUR_AUTH_SERVICE_SUCCESS ) { $ auth = Auth :: getInstance ( ) ; $ auth -> login ( $ this -> adapter -> getIdentity ( ) ) ; $ auth -> setRoles ( $ this -> adapter -> getRoles ( ) ) ; return true ; } elseif ( $ result === self :: PHAVOUR_AUTH_SERVICE_INVALID ) { throw new InvalidCredentialsException ( 'Invalid credentials exception' ) ; } throw new UnrecognisedAuthenticationResultException ( 'Expected 1 or 2' ) ; }
Log a user in using the given adapter from the construct
@throws InvalidCredentialsException
@throws UnrecognisedAuthenticationResultException
@return boolean|throws
Log a user in using the given adapter from the construct