From 60a6011b37323c175c8dbf77fef07bc8bb9f31f7 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 2 Apr 2024 16:07:13 +0000 Subject: [PATCH] Resorted deletes and added comment for Filesystem-Magic --- application/models/User_model.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/models/User_model.php b/application/models/User_model.php index 16c938f25..05bd503b8 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -335,8 +335,11 @@ class User_Model extends CI_Model { $this->load->model('Stations'); $stations = $this->Stations->all_of_user($user_id); foreach ($stations->result() as $row) { + // Todo: Fetch EACH COL_PRIMARY_KEY (via inner join) from Log-table and delete also eQSL-file within filesystem (Function missing here) depending on path-configuration $this->db->query("DELETE e FROM `eQSL_images` e inner join ".$this->config->item('table_name')." qsos where e.qso_id=qsos.COL_PRIMARY_KEY and qsos.station_id=?",$row->station_id); + // Todo: Fetch EACH COL_PRIMARY_KEY (via inner join) from Log-table and delete also QSL-file within filesystem (Function missing here) depending on path-configuration $this->db->query("DELETE q FROM qsl_images q inner join ".$this->config->item('table_name')." qsos WHERE q.qsoid=qsos.COL_PRIMARY_KEY and qsos.station_id = ?",$row->station_id); + $this->db->query("DELETE c FROM contest_session c WHERE c.station_id =?",$row->station_id); $this->db->query("DELETE FROM oqrs WHERE station_id = ?",$row->station_id); $this->db->query("DELETE FROM ".$this->config->item('table_name')." WHERE station_id = ?",$row->station_id); @@ -353,8 +356,8 @@ class User_Model extends CI_Model { $this->db->query("DELETE FROM queries WHERE userid = ?",$user_id); $this->db->query("DELETE FROM station_profile WHERE user_id = ?",$user_id); $this->db->query("DELETE FROM station_logbooks WHERE user_id = ?",$user_id); - $this->db->query("DELETE FROM ".$this->config->item('auth_table')." WHERE user_id = ?",$user_id); $this->db->query("delete from user_options where user_id=?",$user_id); + $this->db->query("DELETE FROM ".$this->config->item('auth_table')." WHERE user_id = ?",$user_id); return 1; } else { return 0;