diff --git a/application/controllers/Update.php b/application/controllers/Update.php index 5d6c0e0f3..542a4e380 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -11,7 +11,7 @@ class Update extends CI_Controller { function __construct() { parent::__construct(); - + if (ENVIRONMENT == 'maintenance' && $this->session->userdata('user_id') == '') { echo "Maintenance Mode is active. Try again later.\n"; redirect('user/login'); @@ -258,22 +258,45 @@ class Update extends CI_Controller { } public function check_missing_dxcc($all = false){ - $this->load->model('logbook_model'); - $this->logbook_model->check_missing_dxcc_id($all); + $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'); + } + $this->load->model('logbook_model'); + $this->logbook_model->check_missing_dxcc_id($all); } public function check_missing_continent() { + $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'); + } + $this->load->model('logbook_model'); $this->logbook_model->check_missing_continent(); } public function update_distances() { + $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'); + } + $this->load->model('logbook_model'); $this->logbook_model->update_distances(); } public function check_missing_grid($all = false){ + $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'); + } + $this->load->model('logbook_model'); $this->logbook_model->check_missing_grid_id($all); } diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 01aa3f7db..7a0a58b4d 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -4368,8 +4368,6 @@ function lotw_last_qsl_date($user_id) { if (!$all){ $this->db->where("COL_DXCC is NULL"); } - $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); - $this->db->where('station_profile.user_id', $this->session->userdata('user_id')); $r = $this->db->get($this->config->item('table_name'));