From 77f34cd942512cedd215a764a90d66661c1049ec Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 16 Mar 2026 00:50:21 +0100 Subject: [PATCH] add userid to band deletion --- application/controllers/Band.php | 3 ++- application/models/Bands.php | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/application/controllers/Band.php b/application/controllers/Band.php index 17040f606..a1857b462 100644 --- a/application/controllers/Band.php +++ b/application/controllers/Band.php @@ -118,8 +118,9 @@ class Band extends CI_Controller { public function delete() { $id = $this->input->post('id', true); + $userid = $this->session->userdata('user_id'); $this->load->model('bands'); - $this->bands->delete($id); + $this->bands->delete($id, $userid); } public function activate() { diff --git a/application/models/Bands.php b/application/models/Bands.php index 17b2cc588..213f86722 100644 --- a/application/models/Bands.php +++ b/application/models/Bands.php @@ -300,12 +300,8 @@ class Bands extends CI_Model { return true; } - function delete($id) { - // Clean ID - $clean_id = $this->security->xss_clean($id); - - // Delete Mode - $this->db->delete('bandxuser', array('id' => $clean_id)); + function delete($id, $userid) { + $this->db->delete('bandxuser', array('id' => $id, 'userid' => $userid)); } function saveBand($id, $band) {