From caf43f2259dd33fce80a9691118863aa83cd461b Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Fri, 21 Jun 2019 21:22:22 +0100 Subject: [PATCH] Added function for deleting API keys Added a function to delete API keys in the API model, this will be exposed via the api.php controller with a frontend component --- application/models/Api_model.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/models/Api_model.php b/application/models/Api_model.php index 045c746d..08946a21 100644 --- a/application/models/Api_model.php +++ b/application/models/Api_model.php @@ -19,6 +19,10 @@ class API_Model extends CI_Model { return $this->db->get('api'); } + function delete_key($key) { + $this->db->where('id', $key); + $this->db->delete('api'); + } // Generate API Key function generate_key($rights) {