protected function loginUser()
    {
        $user = $this->getSubmitted();
        $result = $this->user_action->login($user);

        if (empty($result['user'])) {
            $this->setData('user', $user);
            $this->setMessage($result['message'], $result['severity']);
        } else {
            $this->redirect($result['redirect'], $result['message'], $result['severity']);
        }
    }