From 4e618d42a231e06077f60fd6ad93e92024be6ae1 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Wed, 11 Sep 2019 17:35:31 +0100 Subject: [PATCH] Removed auth check on search if public search is true --- application/controllers/Search.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/application/controllers/Search.php b/application/controllers/Search.php index b0189c14..4285ed5b 100644 --- a/application/controllers/Search.php +++ b/application/controllers/Search.php @@ -8,24 +8,14 @@ class Search extends CI_Controller { parent::__construct(); $this->load->helper(array('form', 'url')); - - $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'); } + if($this->config->item('public_search') != TRUE) { + $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'); } + } } public function index() { - // Auth check - $this->load->model('user_model'); - if(!$this->user_model->authorize($this->config->item('auth_mode'))) { - if($this->user_model->validate_session()) { - $this->user_model->clear_session(); - show_error('Access denied

Click here to log in as another user', 403); - } else { - redirect('user/login'); - } - } - $data['page_title'] = "Search"; $this->load->view('interface_assets/header', $data);