From 944ec0d12d72b5454ef16efbf6872d671144c8c7 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 4 Jun 2024 04:39:13 +0000 Subject: [PATCH 1/3] Lock Account also at download --- application/models/Clublog_model.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 024131ccf..81f046c2e 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -159,11 +159,15 @@ class Clublog_model extends CI_Model $return = curl_error($request); } elseif (preg_match_all('/Login rejected/', $response)) { $return = "Wrong Clublog username and password for Callsign: '" . $station_row->station_callsign . "'. 'LOGIN REJECTED'."; - log_message('error', $return); + log_message('debug', $return); + $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; + $this->db->query($sql,$station_row->station_id); } elseif (preg_match_all('/Invalid callsign/', $response)) { // We're trying to download calls for a station we're not granted. Disable Clublog-Transfer for that station(s) $this->disable_sync4call($station_row->station_callsign, $station_row->station_ids); $return = "The callsign '" . $station_row->station_callsign . "' does not match the user account at Clublog. 'INVALID CALLSIGN'."; log_message('debug', $return); + $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; + $this->db->query($sql,$station_row->station_id); } else { try { $cl_qsls = json_decode($response); From 5fa8c29798a735f03eb5205dae85bfb4cdaa2e6e Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 4 Jun 2024 04:43:27 +0000 Subject: [PATCH 2/3] Whitepacing at that section --- application/models/Clublog_model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 81f046c2e..9b6854b80 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -160,14 +160,14 @@ class Clublog_model extends CI_Model } elseif (preg_match_all('/Login rejected/', $response)) { $return = "Wrong Clublog username and password for Callsign: '" . $station_row->station_callsign . "'. 'LOGIN REJECTED'."; log_message('debug', $return); - $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; - $this->db->query($sql,$station_row->station_id); + $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; + $this->db->query($sql,$station_row->station_id); } elseif (preg_match_all('/Invalid callsign/', $response)) { // We're trying to download calls for a station we're not granted. Disable Clublog-Transfer for that station(s) $this->disable_sync4call($station_row->station_callsign, $station_row->station_ids); $return = "The callsign '" . $station_row->station_callsign . "' does not match the user account at Clublog. 'INVALID CALLSIGN'."; log_message('debug', $return); - $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; - $this->db->query($sql,$station_row->station_id); + $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; + $this->db->query($sql,$station_row->station_id); } else { try { $cl_qsls = json_decode($response); From 2d040f7f3dac571573b7db49c1b7af058b1cf2cb Mon Sep 17 00:00:00 2001 From: int2001 Date: Thu, 6 Jun 2024 09:06:54 +0000 Subject: [PATCH 3/3] Fixed disabling, since we have to deal with multiple station_locations here --- application/models/Clublog_model.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 9b6854b80..e2374d00e 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -158,16 +158,13 @@ class Clublog_model extends CI_Model if (curl_errno($request)) { $return = curl_error($request); } elseif (preg_match_all('/Login rejected/', $response)) { + $this->disable_sync4call($station_row->station_callsign, $station_row->station_ids); $return = "Wrong Clublog username and password for Callsign: '" . $station_row->station_callsign . "'. 'LOGIN REJECTED'."; log_message('debug', $return); - $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; - $this->db->query($sql,$station_row->station_id); } elseif (preg_match_all('/Invalid callsign/', $response)) { // We're trying to download calls for a station we're not granted. Disable Clublog-Transfer for that station(s) $this->disable_sync4call($station_row->station_callsign, $station_row->station_ids); $return = "The callsign '" . $station_row->station_callsign . "' does not match the user account at Clublog. 'INVALID CALLSIGN'."; log_message('debug', $return); - $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; - $this->db->query($sql,$station_row->station_id); } else { try { $cl_qsls = json_decode($response);