From 1e32fbed3f7cce4038b99a7c7ef5fee73fd0fa9f Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 24 Aug 2022 16:04:26 +0200 Subject: [PATCH] Implement check if LotW cert itself is valid to use for signing. If not skip. --- application/controllers/Lotw.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 041db3be..502647f1 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -229,6 +229,18 @@ class Lotw extends CI_Controller { continue; } + // Check if LotW certificate itself is valid + // Validty of QSO dates will be checked later + $current_date = date('Y-m-d H:i:s'); + if ($current_date <= $data['lotw_cert_info']->date_created) { + echo $data['lotw_cert_info']->callsign.": LotW certificate not valid yet!"; + continue; + } + if ($current_date >= $data['lotw_cert_info']->date_expires) { + echo $data['lotw_cert_info']->callsign.": LotW certificate expired!"; + continue; + } + $this->load->model('Dxcc'); $data['station_profile_dxcc'] = $this->Dxcc->lookup_country($data['lotw_cert_info']->cert_dxcc);