From 6f39ce940ff92c89e3c1a62f8a144155e69e046b Mon Sep 17 00:00:00 2001 From: Thomas Werzmirzowsky Date: Sun, 31 Oct 2021 10:25:35 +0100 Subject: [PATCH] - QSO create/edit check that station belongs to user - QSO form only shows stations of user --- application/controllers/Qso.php | 2 +- application/models/Logbook_model.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index 245fc1a9..c852bd14 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -30,7 +30,7 @@ class QSO extends CI_Controller { $data['active_station_profile'] = $this->stations->find_active(); $data['notice'] = false; - $data['stations'] = $this->stations->all(); + $data['stations'] = $this->stations->all_of_user(); $data['radios'] = $this->cat->radios(); $data['query'] = $this->logbook_model->last_custom('5'); $data['dxcc'] = $this->logbook_model->fetchDxcc(); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 32cb1b17..9e455fed 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -462,6 +462,13 @@ class Logbook_model extends CI_Model { $stationId = $this->input->post('station_profile'); $country = $entity['name']; + // be sure that station belongs to user + $CI =& get_instance(); + $CI->load->model('Stations'); + if (!$CI->Stations->check_station_is_accessible($stationId)) { + return; + } + $mode = $this->get_main_mode_if_submode($this->input->post('mode')); if ($mode == null) { $mode = $this->input->post('mode');