diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 579d7b3e..78672286 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -35,6 +35,9 @@ class Lotw extends CI_Controller { | */ public function index() { + $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'); } + // Load required models for page generation $this->load->model('LotwCert'); @@ -50,12 +53,6 @@ class Lotw extends CI_Controller { $this->load->view('interface_assets/footer'); } - public function test1() { - if (!file_exists('./uploads/lotw/certs')) { - mkdir('./uploads/lotw/certs', 0777, true); - } - } - /* |-------------------------------------------------------------------------- | Function: cert_upload @@ -65,6 +62,9 @@ class Lotw extends CI_Controller { | */ public function cert_upload() { + $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'); } + // Set Page Title $data['page_title'] = "Logbook of the World"; @@ -85,6 +85,8 @@ class Lotw extends CI_Controller { */ public function do_cert_upload() { + $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'); } // create folder to store certs while processing if (!file_exists('./uploads/lotw/certs')) { @@ -317,6 +319,9 @@ class Lotw extends CI_Controller { | */ public function delete_cert($cert_id) { + $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('LotwCert'); $this->LotwCert->delete_certficiate($this->session->userdata('user_id'), $cert_id); @@ -326,23 +331,6 @@ class Lotw extends CI_Controller { redirect('/lotw/'); } - /* - |-------------------------------------------------------------------------- - | Function: peter - |-------------------------------------------------------------------------- - | - | Temp function to test development bits - | - */ - public function peter() { - $this->load->model('LotwCert'); - $this->load->model('Logbook_model'); - $dxcc = $this->Logbook_model->check_dxcc_table("2M0SQL", "2020-05-07 17:20:27"); - - print_r($dxcc); - // Get Array of the logged in users LOTW certs. - echo $this->LotwCert->find_cert($this->session->userdata('user_id'), "2M0SQL"); - } /* |-------------------------------------------------------------------------- @@ -354,6 +342,9 @@ class Lotw extends CI_Controller { | */ public function decrypt_key($file, $password = "") { + $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'); } + $results = array(); $password = $password; // Only needed if 12 has a password set $filename = file_get_contents('file://'.$file); diff --git a/application/views/lotw_views/index.php b/application/views/lotw_views/index.php index 9af5264e..469a080a 100644 --- a/application/views/lotw_views/index.php +++ b/application/views/lotw_views/index.php @@ -92,4 +92,17 @@ +
+ + +
+
+ Information +
+ +
+

You can run the LoTW upload script manually using , this should be run as a cron task hourly or greater not in real time.

+
+
+