From 9b8965113886dfde0d9c9050f0ebdc7272632339 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 8 Aug 2023 17:13:01 +0000 Subject: [PATCH] SOTA-Export was broken for Non-Admins... --- application/controllers/Csv.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/controllers/Csv.php b/application/controllers/Csv.php index af1b1402..de02ce43 100644 --- a/application/controllers/Csv.php +++ b/application/controllers/Csv.php @@ -5,7 +5,7 @@ class Csv extends CI_Controller { public function index() { $this->load->model('user_model'); - if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } $this->load->model('modes'); $this->load->model('logbook_model'); @@ -26,8 +26,11 @@ class Csv extends CI_Controller { } public function export() { - $this->load->model('csv_model'); + $this->load->model('user_model'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + + $this->load->model('csv_model'); // Parameters $station_id = $this->security->xss_clean($this->input->post('station_profile')); $band = $this->security->xss_clean($this->input->post('band'));