From 8cfa51fa24b3e0c416992eef7351cf0f8ed6aec6 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 5 Sep 2020 21:42:07 +0100 Subject: [PATCH] Added OpenSSL is required Warning to LOTW pages if modules missing --- application/controllers/Lotw.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 9c7a8370..67d40b0f 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -38,6 +38,11 @@ class Lotw extends CI_Controller { $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'); } + // Fire OpenSSL missing error if not found + if (!extension_loaded('openssl')) { + echo "You must install php OpenSSL for LoTW functions to work"; + } + // Load required models for page generation $this->load->model('LotwCert'); @@ -88,6 +93,11 @@ class Lotw extends CI_Controller { $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'); } + // Fire OpenSSL missing error if not found + if (!extension_loaded('openssl')) { + echo "You must install php OpenSSL for LoTW functions to work"; + } + // create folder to store certs while processing if (!file_exists('./uploads/lotw/certs')) { mkdir('./uploads/lotw/certs', 0755, true); @@ -175,6 +185,12 @@ class Lotw extends CI_Controller { | */ public function lotw_upload() { + + // Fire OpenSSL missing error if not found + if (!extension_loaded('openssl')) { + echo "You must install php OpenSSL for LoTW functions to work"; + } + // Get Station Profile Data $this->load->model('Stations');