diff --git a/application/core/Auth_Controller.php b/application/core/Auth_Controller.php index dfddc5d30..1427a318d 100644 --- a/application/core/Auth_Controller.php +++ b/application/core/Auth_Controller.php @@ -34,7 +34,7 @@ class Auth_Controller extends FHC_Controller // Checks if this user is entitled to access to this content if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method)) { - header('HTTP/1.0 401 Unauthorized'); // set the HTTP header as unauthorized + $this->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized $this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output diff --git a/application/libraries/AuthLib.php b/application/libraries/AuthLib.php index 43b8bd2d6..deebcb3ee 100644 --- a/application/libraries/AuthLib.php +++ b/application/libraries/AuthLib.php @@ -305,7 +305,7 @@ class AuthLib */ private function _showInvalidAuthentication() { - header('HTTP/1.0 401 Unauthorized'); // set the HTTP header as unauthorized + $this->_ci->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized unset($_SERVER['PHP_AUTH_USER']); $this->_ci->load->library('EPrintfLib'); // loads the EPrintfLib to format the output @@ -325,6 +325,8 @@ class AuthLib */ private function _showError($errorMessage) { + $this->_ci->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized + $this->_ci->load->library('EPrintfLib'); // loads the EPrintfLib to format the output $this->_ci->load->library('LogLib'); // Loads the logs library