Auth_Basic::login PHP Method

login() public method

Manually Log in as specified users by using login name.
public login ( string $user )
$user string
    public function login($user)
    {
        if (is_object($user)) {
            if (!$this->model) {
                throw $this->exception('Auth Model should be set');
            }
            $c = get_class($this->model);
            if (!$user instanceof $c) {
                throw $this->exception('Specified model with incompatible class')->addMoreInfo('required', $c)->addMoreInfo('supplied', get_class($user));
            }
            $this->model = $user;
            $this->memorizeModel();
            return $this;
        }
        $this->model->tryLoadBy($this->login_field, $user);
        $this->memorizeModel();
        return $this;
    }