From aad1823e158c9c149404323f0217eda4c429b0e9 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 14 Nov 2021 22:53:35 +0000 Subject: [PATCH] [Hardware] Allowed all user roles to view --- application/controllers/Radio.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/application/controllers/Radio.php b/application/controllers/Radio.php index 2a2a5709..ecc00052 100755 --- a/application/controllers/Radio.php +++ b/application/controllers/Radio.php @@ -6,8 +6,13 @@ { // Check Auth $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'); } + // Check if users logged in + + if($this->user_model->validate_session() == 0) { + // user is not logged in + redirect('user/login'); + } // load the view $data['page_title'] = "Hardware Interfaces"; @@ -20,8 +25,14 @@ // Check Auth $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'); } + // Check if users logged in + + if($this->user_model->validate_session() == 0) { + // user is not logged in + redirect('user/login'); + } + $this->load->model('cat'); $query = $this->cat->status(); if ($query->num_rows() > 0)