From a8be9179c33c0b30622465f62d6e3c6fda97d292 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 30 Nov 2023 12:26:31 +0100 Subject: [PATCH] Fix some issues in LoTW controller --- application/controllers/Lotw.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index b3fe1225..8e1f475f 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -631,6 +631,12 @@ class Lotw extends CI_Controller { if ($query->num_rows() >= 1) { $result = ''; + + // Get URL for downloading LoTW + $url_query = $this->db->query('SELECT lotw_download_url FROM config'); + $q = $url_query->row(); + $lotw_url = $q->lotw_download_url; + foreach ($query->result() as $user) { if ( ($sync_user_id != null) && ($sync_user_id != $user->user_id) ) { continue; } @@ -652,11 +658,6 @@ class Lotw extends CI_Controller { $data['user_lotw_name'] = urlencode($user->user_lotw_name); $data['user_lotw_password'] = urlencode($user->user_lotw_password); - // Get URL for downloading LoTW - $query = $query = $this->db->query('SELECT lotw_download_url FROM config'); - $q = $query->row(); - $lotw_url = $q->lotw_download_url; - $lotw_last_qsl_date = date('Y-m-d', strtotime($this->logbook_model->lotw_last_qsl_date($user->user_id))); // Build URL for LoTW report file @@ -681,9 +682,6 @@ class Lotw extends CI_Controller { ini_set('memory_limit', '-1'); $result = $this->loadFromFile($file, false); } - if ($result == '') { - $result = "You have not defined your ARRL LoTW credentials!"; - } return $result; } else { return "No LoTW User details found to carry out matches.";