From 7484b3262493670cc18ad39d124e648b5ec40115 Mon Sep 17 00:00:00 2001 From: Emiliano Macedonio Date: Mon, 27 May 2024 11:23:32 +0200 Subject: [PATCH] Revert "[API] Add check_auth function with json output" This reverts commit b2168badd959e48b26c62b34e2515e119dff056e. --- application/controllers/Api.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 7bb18b5a..fdd10aa5 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -127,29 +127,6 @@ class API extends CI_Controller { } } - function check_auth($key) { - $this->load->model('api_model'); - header("Content-type: text/xml"); - if($this->api_model->access($key) == "No Key Found" || $this->api_model->access($key) == "Key Disabled") { - // set the content type as json - header("Content-type: application/json"); - - // set the http response code to 401 - http_response_code(401); - - // return the json with the status as failed - echo json_encode(['status' => 'failed', 'reason' => "missing or invalid api key"]); - } else { - // set the content type as json - header("Content-type: application/json"); - - // set the http response code to 200 - http_response_code(200); - // return the json - echo json_encode(['status' => 'valid', 'rights' => $this->api_model->access($key)]); - } - } - function station_info($key) { $this->load->model('api_model'); $this->load->model('stations');