From 200f6d965fed98a2eec1c9fc489b3b0d35bfc7bd Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Fri, 7 Jun 2024 13:50:42 +0200 Subject: [PATCH 1/8] * [OQRS] show menu entry only if requests occur --- application/views/interface_assets/header.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 3cb20c926..64d2fbd4e 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -394,10 +394,12 @@ } $oqrs_requests = $this->oqrs_model->oqrs_requests($location_list); + if ($oqrs_requests > 0) { ?>
  • 0) { echo "" . $oqrs_requests . ""; } ?>
  • +
  • From 71f6896b69afd0c0bc5bf8c8eb605bb1dfb91aa1 Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Fri, 7 Jun 2024 14:27:32 +0200 Subject: [PATCH 2/8] * [OQRS] config-switch to disable oqrs-feature --- application/config/config.sample.php | 3 +++ application/controllers/Oqrs.php | 2 ++ application/views/station_profile/create.php | 2 ++ application/views/station_profile/edit.php | 3 +++ 4 files changed, 10 insertions(+) diff --git a/application/config/config.sample.php b/application/config/config.sample.php index 4bf15d48b..4488d04b8 100644 --- a/application/config/config.sample.php +++ b/application/config/config.sample.php @@ -695,3 +695,6 @@ $config['disable_manual_qrz'] = false; # Disables QSL-Image-Feature if true. if non-existant or false the QSL-Feature is enabled $config['disable_qsl'] = false; + +# Disables OQRS-Feature if true. if non-existant or false the OQRS-Feature is enabled +$config['disable_oqrs'] = false; diff --git a/application/controllers/Oqrs.php b/application/controllers/Oqrs.php index e8b22bec6..5a77e36e6 100644 --- a/application/controllers/Oqrs.php +++ b/application/controllers/Oqrs.php @@ -17,6 +17,8 @@ class Oqrs extends CI_Controller { } public function index() { + if (($this->config->item('disable_oqrs') ?? false)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + $this->load->model('oqrs_model'); $data['stations'] = $this->oqrs_model->get_oqrs_stations(); diff --git a/application/views/station_profile/create.php b/application/views/station_profile/create.php index 58e531b10..00ad27c4f 100644 --- a/application/views/station_profile/create.php +++ b/application/views/station_profile/create.php @@ -259,6 +259,7 @@ +config->item('disable_oqrs') ?? false)) { ?>
    + diff --git a/application/views/station_profile/edit.php b/application/views/station_profile/edit.php index 7667a59cf..53ec4271b 100644 --- a/application/views/station_profile/edit.php +++ b/application/views/station_profile/edit.php @@ -390,6 +390,8 @@ + +config->item('disable_oqrs') ?? false)) { ?>
    @@ -420,6 +422,7 @@
    + From c2d888872c5f06327aabf40fd18cc7a623fe7a59 Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Mon, 10 Jun 2024 14:29:31 +0200 Subject: [PATCH 3/8] * [OQRS] also disable the admin menu --- application/views/options/oqrs.php | 4 +++- application/views/options/sidebar.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/application/views/options/oqrs.php b/application/views/options/oqrs.php index 82664daaf..a5ee4a88b 100644 --- a/application/views/options/oqrs.php +++ b/application/views/options/oqrs.php @@ -1,3 +1,4 @@ +config->item('disable_oqrs') ?? false)) { ?>
    @@ -66,4 +67,5 @@
    - \ No newline at end of file + + diff --git a/application/views/options/sidebar.php b/application/views/options/sidebar.php index 902bd3968..dad74caca 100644 --- a/application/views/options/sidebar.php +++ b/application/views/options/sidebar.php @@ -4,7 +4,9 @@
  • + config->item('disable_oqrs') ?? false)) { ?>
  • +
  • From b03872324b39db5c94db5533c22905107e2deeaa Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Mon, 10 Jun 2024 14:57:10 +0200 Subject: [PATCH 4/8] * [OQRS] disable the entire controller --- application/controllers/Oqrs.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/controllers/Oqrs.php b/application/controllers/Oqrs.php index 5a77e36e6..4671408c7 100644 --- a/application/controllers/Oqrs.php +++ b/application/controllers/Oqrs.php @@ -14,11 +14,10 @@ class Oqrs extends CI_Controller { // Commented out to get public access // $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('disable_oqrs') ?? false)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } } public function index() { - if (($this->config->item('disable_oqrs') ?? false)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - $this->load->model('oqrs_model'); $data['stations'] = $this->oqrs_model->get_oqrs_stations(); From dc05f692c9e5b93443e01bf805425ad7d563e706 Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Thu, 13 Jun 2024 12:13:16 +0200 Subject: [PATCH 5/8] * [OQRS] also add the configuration switch in the installer --- install/config/config.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/config/config.php b/install/config/config.php index 645552163..4351f5833 100644 --- a/install/config/config.php +++ b/install/config/config.php @@ -692,3 +692,6 @@ $config['disable_manual_lotw'] = false; $config['disable_manual_eqsl'] = false; $config['disable_manual_hrdlog'] = false; $config['disable_manual_qrz'] = false; + +# Disables OQRS-Feature if true. if non-existant or false the OQRS-Feature is enabled +$config['disable_oqrs'] = false; From c58bf3ec73b6359e7a1c0cd326be19e493369380 Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Thu, 13 Jun 2024 13:17:45 +0200 Subject: [PATCH 6/8] * [OQRS] incomplete PHP closing --- application/views/options/oqrs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/options/oqrs.php b/application/views/options/oqrs.php index a5ee4a88b..40ef70924 100644 --- a/application/views/options/oqrs.php +++ b/application/views/options/oqrs.php @@ -68,4 +68,4 @@ - + From f1ff18cbb01173a4c4b465d2875bf75bd69d6b8c Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Thu, 13 Jun 2024 14:14:47 +0200 Subject: [PATCH 7/8] * [OQRS] hide button in public visitor pages --- application/views/visitor/layout/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/visitor/layout/header.php b/application/views/visitor/layout/header.php index 64dc20d88..5b7b77ea4 100644 --- a/application/views/visitor/layout/header.php +++ b/application/views/visitor/layout/header.php @@ -69,7 +69,7 @@ CI =& get_instance(); - if ($this->CI->oqrs_enabled($slug)) { + if ($this->CI->oqrs_enabled($slug) && !$this->CI->config->item('disable_oqrs')) { ?>
  • 0) { echo "" . $oqrs_requests . "";