From 63a326375a7f82d48088b74b0f58ce618f2916c3 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 7 Oct 2025 15:42:36 +0000 Subject: [PATCH 01/13] More new errormessages from Clublog --- application/models/Clublog_model.php | 157 ++++++++++++++------------- 1 file changed, 82 insertions(+), 75 deletions(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 89cfbc375..1d5107767 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -18,7 +18,7 @@ class Clublog_model extends CI_Model function uploadUser($userid, $username, $password, $station_id = null) { $clean_username = $this->security->xss_clean($username); - $clean_passord = $this->security->xss_clean($password); + $clean_password = $this->security->xss_clean($password); $clean_userid = $this->security->xss_clean($userid); $return = "No QSOs to upload"; @@ -45,88 +45,95 @@ class Clublog_model extends CI_Model if ($data['qsos']->num_rows()) { $string = $this->load->view('adif/data/clublog', $data, TRUE); - $ranid = uniqid(); - - if (!write_file('uploads/clublog' . $ranid . $station_row->station_id . '.adi', $string)) { - $return = 'Unable to write the file - Make the folder Upload folder has write permissions.'; + if ($data['qsos']->num_rows() == 1) { // exactly ONE QSO --> use their realtime.api as demanded by clublog + push_qso_to_clublog($clean_username, $clean_password, $station_row->station_callsign, $string, $station_id); } else { - - // initialise the curl request - $request = curl_init('https://clublog.org/putlogs.php'); - $filepath = realpath('uploads/clublog' . $ranid . $station_row->station_id . '.adi'); - - // Check if the file actually exists - if (!file_exists($filepath)) { - $return .= " Clublog upload for " . $station_row->station_callsign . ' failed. Upload file could not be created.'; - log_message('error', $return); - return $return . "\n"; - } - - if (function_exists('curl_file_create')) { // php 5.5+ - $cFile = curl_file_create($filepath); + $ranid = uniqid(); + if (!write_file('uploads/clublog' . $ranid . $station_row->station_id . '.adi', $string)) { + $return = 'Unable to write the file - Make the folder Upload folder has write permissions.'; } else { - $cFile = '@' . $filepath; - } - $cFile->setPostFilename(basename($filepath)); - // send a file - curl_setopt($request, CURLOPT_POST, true); - curl_setopt($request, CURLOPT_TIMEOUT, 10); - curl_setopt( - $request, - CURLOPT_POSTFIELDS, - array( - 'email' => $clean_username, - 'password' => $clean_passord, - 'callsign' => $station_row->station_callsign, - 'api' => $this->clublog_identifier, - 'file' => $cFile + // initialise the curl request + $request = curl_init('https://clublog.org/putlogs.php'); + $filepath = realpath('uploads/clublog' . $ranid . $station_row->station_id . '.adi'); + + // Check if the file actually exists + if (!file_exists($filepath)) { + $return .= " Clublog upload for " . $station_row->station_callsign . ' failed. Upload file could not be created.'; + log_message('error', $return); + return $return . "\n"; + } + + if (function_exists('curl_file_create')) { // php 5.5+ + $cFile = curl_file_create($filepath); + } else { + $cFile = '@' . $filepath; + } + $cFile->setPostFilename(basename($filepath)); + + // send a file + curl_setopt($request, CURLOPT_POST, true); + curl_setopt($request, CURLOPT_TIMEOUT, 10); + curl_setopt( + $request, + CURLOPT_POSTFIELDS, + array( + 'email' => $clean_username, + 'password' => $clean_password, + 'callsign' => $station_row->station_callsign, + 'api' => $this->clublog_identifier, + 'file' => $cFile ) ); - // output the response - curl_setopt($request, CURLOPT_RETURNTRANSFER, true); - $response = curl_exec($request); - $info = curl_getinfo($request); - $httpcode = curl_getinfo($request, CURLINFO_HTTP_CODE); - if (curl_errno($request)) { - $return = curl_error($request); - } - curl_close($request); - - // If Clublog Accepts mark the QSOs - if (($httpcode == 200) || (preg_match('/\baccepted\b/', $response))) { - $return = "QSOs uploaded and Logbook QSOs marked as sent to Clublog."; - $this->mark_qsos_sent($station_row->station_id); - $return .= " Clublog upload for " . $station_row->station_callsign . ' successfully sent.'; - log_message('info', 'Clublog upload for ' . $station_row->station_callsign . ' successfully sent and marked.'); - } else if (preg_match('/checksum duplicate/', $response)) { // Be safe, if Michael rolls back to 403 on duplicate - $return = "QSOs uploaded (as duplicate!) and Logbook QSOs marked as sent to Clublog"; - $this->mark_qsos_sent($station_row->station_id); - $return .= " Clublog upload for " . $station_row->station_callsign . ' successfully sent.'; - log_message('info', 'Clublog DUPLICATE upload for ' . $station_row->station_callsign . ' successfully sent and marked.'); - } else { - $return = 'Clublog upload for ' . $station_row->station_callsign . ' failed reason ' . $response.' // HTTP:'.$httpcode.' / '.$return; - log_message('error', $return); - if (substr($response,0,13) == 'Upload denied') { // Deactivate Upload for Station if Clublog rejects it due to non-configured Call (prevent being blacklisted at Clublog) - log_message('info', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to non-configured Call (prevent being blacklisted at Clublog.'); - $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; - $this->db->query($sql,$station_row->station_id); - } else if (substr($response,0,14) == 'Login rejected') { // Deactivate Upload for Station if Clublog rejects it due to wrong credentials (prevent being blacklisted at Clublog) - log_message('info', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to wrong credentials (prevent being blacklisted at Clublog.'); - $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; - $this->db->query($sql,$station_row->station_id); - } else if ($httpcode == 403) { - log_message('info', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to 403 (prevent being blacklisted at Clublog.'); - $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; - $this->db->query($sql,$station_row->station_id); - } else { - log_message('error', 'Some uncaught exception for station ' . $station_row->station_callsign); + // output the response + curl_setopt($request, CURLOPT_RETURNTRANSFER, true); + $response = curl_exec($request); + $info = curl_getinfo($request); + $httpcode = curl_getinfo($request, CURLINFO_HTTP_CODE); + if (curl_errno($request)) { + $return = curl_error($request); } - } + curl_close($request); - // Delete the ADIF file used for clublog - unlink('uploads/clublog' . $ranid . $station_row->station_id . '.adi'); + // If Clublog Accepts mark the QSOs + if (($httpcode == 200) || (preg_match('/\baccepted\b/', $response))) { + $return = "QSOs uploaded and Logbook QSOs marked as sent to Clublog."; + $this->mark_qsos_sent($station_row->station_id); + $return .= " Clublog upload for " . $station_row->station_callsign . ' successfully sent.'; + log_message('info', 'Clublog upload for ' . $station_row->station_callsign . ' successfully sent and marked.'); + } else if (preg_match('/too many uploads already queued/', $response)) { // New Error, Clublog has Backlog, skip for NOW + $return = 'Clublog upload for ' . $station_row->station_callsign . ' failed, clublog tells backlog there. Skipping whole account for this cycle. Detailled reason ' . $response.' // HTTP:'.$httpcode.' / '.$return; + unlink('uploads/clublog' . $ranid . $station_row->station_id . '.adi'); + break; + } else if (preg_match('/checksum duplicate/', $response)) { // Be safe, if Michael rolls back to 403 on duplicate + $return = "QSOs uploaded (as duplicate!) and Logbook QSOs marked as sent to Clublog"; + $this->mark_qsos_sent($station_row->station_id); + $return .= " Clublog upload for " . $station_row->station_callsign . ' successfully sent.'; + log_message('info', 'Clublog DUPLICATE upload for ' . $station_row->station_callsign . ' successfully sent and marked.'); + } else { + $return = 'Clublog upload for ' . $station_row->station_callsign . ' failed reason ' . $response.' // HTTP:'.$httpcode.' / '.$return; + log_message('error', $return); + if (substr($response,0,13) == 'Upload denied') { // Deactivate Upload for Station if Clublog rejects it due to non-configured Call (prevent being blacklisted at Clublog) + log_message('info', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to non-configured Call (prevent being blacklisted at Clublog.'); + $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; + $this->db->query($sql,$station_row->station_id); + } else if (substr($response,0,14) == 'Login rejected') { // Deactivate Upload for Station if Clublog rejects it due to wrong credentials (prevent being blacklisted at Clublog) + log_message('info', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to wrong credentials (prevent being blacklisted at Clublog.'); + $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; + $this->db->query($sql,$station_row->station_id); + } else if ($httpcode == 403) { + log_message('info', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to 403 (prevent being blacklisted at Clublog.'); + $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; + $this->db->query($sql,$station_row->station_id); + } else { + log_message('error', 'Some uncaught exception for station ' . $station_row->station_callsign); + } + } + + // Delete the ADIF file used for clublog + unlink('uploads/clublog' . $ranid . $station_row->station_id . '.adi'); + } } } else { $return = "Nothing awaiting upload to clublog for " . $station_row->station_callsign; From e3ce20b245b9e98242e6a085bf5e605b60073af6 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 7 Oct 2025 15:51:31 +0000 Subject: [PATCH 02/13] Mark Sent --- application/models/Clublog_model.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 1d5107767..eb6001217 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -46,7 +46,12 @@ class Clublog_model extends CI_Model $string = $this->load->view('adif/data/clublog', $data, TRUE); if ($data['qsos']->num_rows() == 1) { // exactly ONE QSO --> use their realtime.api as demanded by clublog - push_qso_to_clublog($clean_username, $clean_password, $station_row->station_callsign, $string, $station_id); + $singlepush=push_qso_to_clublog($clean_username, $clean_password, $station_row->station_callsign, $string, $station_id); + if ($singlepush['status'] == 'OK') { + $this->mark_qsos_sent($station_row->station_id); + } else { + log_message("Error", "Singlepush for ".$station_row->station_id." / ".$station_row->station_callsign." faied: ".$singlepush['status']); + } } else { $ranid = uniqid(); if (!write_file('uploads/clublog' . $ranid . $station_row->station_id . '.adi', $string)) { From 8da0a0055b19e3a7774a905ea46a1884d22579d2 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 7 Oct 2025 15:59:32 +0000 Subject: [PATCH 03/13] Typo --- application/models/Clublog_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index eb6001217..e8d658f51 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -46,7 +46,7 @@ class Clublog_model extends CI_Model $string = $this->load->view('adif/data/clublog', $data, TRUE); if ($data['qsos']->num_rows() == 1) { // exactly ONE QSO --> use their realtime.api as demanded by clublog - $singlepush=push_qso_to_clublog($clean_username, $clean_password, $station_row->station_callsign, $string, $station_id); + $singlepush=$this->push_qso_to_clublog($clean_username, $clean_password, $station_row->station_callsign, $string, $station_id); if ($singlepush['status'] == 'OK') { $this->mark_qsos_sent($station_row->station_id); } else { From 644080e4fb124030b7efa6d349052ca3abd7c84f Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 7 Oct 2025 16:14:33 +0000 Subject: [PATCH 04/13] More strange/uncatched errors --- application/models/Clublog_model.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index e8d658f51..52cea070f 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -48,7 +48,7 @@ class Clublog_model extends CI_Model if ($data['qsos']->num_rows() == 1) { // exactly ONE QSO --> use their realtime.api as demanded by clublog $singlepush=$this->push_qso_to_clublog($clean_username, $clean_password, $station_row->station_callsign, $string, $station_id); if ($singlepush['status'] == 'OK') { - $this->mark_qsos_sent($station_row->station_id); + $this->mark_qsos_sent($station_row->station_id); } else { log_message("Error", "Singlepush for ".$station_row->station_id." / ".$station_row->station_callsign." faied: ".$singlepush['status']); } @@ -111,6 +111,10 @@ class Clublog_model extends CI_Model $return = 'Clublog upload for ' . $station_row->station_callsign . ' failed, clublog tells backlog there. Skipping whole account for this cycle. Detailled reason ' . $response.' // HTTP:'.$httpcode.' / '.$return; unlink('uploads/clublog' . $ranid . $station_row->station_id . '.adi'); break; + } else if (preg_match('/No QSOs to upload//', $response)) { // Means: Already uploaded (but not marked) - perhaps different logtool, who knows. + $this->mark_qsos_sent($station_row->station_id); + $return = " Clublog upload for " . $station_row->station_callsign . ' successfully sent.'; + log_message('info', 'Clublog No QSOs to upload for ' . $station_row->station_callsign . '. preventive marked.'); } else if (preg_match('/checksum duplicate/', $response)) { // Be safe, if Michael rolls back to 403 on duplicate $return = "QSOs uploaded (as duplicate!) and Logbook QSOs marked as sent to Clublog"; $this->mark_qsos_sent($station_row->station_id); @@ -407,6 +411,8 @@ class Clublog_model extends CI_Model if (preg_match('/\bOK\b/', $response)) { $returner['status'] = 'OK'; + } elseif (preg_match('/\bUpdated QSO\b/', $response)) { + $returner['status'] = 'OK'; } elseif (substr($response,0,14) == 'Login rejected') { // Deactivate Upload for Station if Clublog rejects it due to wrong credentials (prevent being blacklisted at Clublog) log_message("Error","Clublog deactivated for ".$cl_username." because of wrong creds at Realtime-Pusher"); $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; From a42c2e5864f16acf9ae1d8973e13ddb85abbf610 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 7 Oct 2025 16:32:14 +0000 Subject: [PATCH 05/13] More Errormessages / Better logging --- application/models/Clublog_model.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 52cea070f..bcdb26567 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -109,6 +109,7 @@ class Clublog_model extends CI_Model log_message('info', 'Clublog upload for ' . $station_row->station_callsign . ' successfully sent and marked.'); } else if (preg_match('/too many uploads already queued/', $response)) { // New Error, Clublog has Backlog, skip for NOW $return = 'Clublog upload for ' . $station_row->station_callsign . ' failed, clublog tells backlog there. Skipping whole account for this cycle. Detailled reason ' . $response.' // HTTP:'.$httpcode.' / '.$return; + log_message('Error', 'Clublog upload for ' . $station_row->station_callsign . ' has become a victim of clublog-Backlog. Skipping full User for this cycle.'); unlink('uploads/clublog' . $ranid . $station_row->station_id . '.adi'); break; } else if (preg_match('/No QSOs to upload//', $response)) { // Means: Already uploaded (but not marked) - perhaps different logtool, who knows. @@ -124,15 +125,15 @@ class Clublog_model extends CI_Model $return = 'Clublog upload for ' . $station_row->station_callsign . ' failed reason ' . $response.' // HTTP:'.$httpcode.' / '.$return; log_message('error', $return); if (substr($response,0,13) == 'Upload denied') { // Deactivate Upload for Station if Clublog rejects it due to non-configured Call (prevent being blacklisted at Clublog) - log_message('info', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to non-configured Call (prevent being blacklisted at Clublog.'); + log_message('Error', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to non-configured Call (prevent being blacklisted at Clublog.'); $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; $this->db->query($sql,$station_row->station_id); } else if (substr($response,0,14) == 'Login rejected') { // Deactivate Upload for Station if Clublog rejects it due to wrong credentials (prevent being blacklisted at Clublog) - log_message('info', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to wrong credentials (prevent being blacklisted at Clublog.'); + log_message('Error', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to wrong credentials (prevent being blacklisted at Clublog.'); $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; $this->db->query($sql,$station_row->station_id); } else if ($httpcode == 403) { - log_message('info', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to 403 (prevent being blacklisted at Clublog.'); + log_message('Error', 'Deactivated upload for station ' . $station_row->station_callsign . ' due to 403 (prevent being blacklisted at Clublog.'); $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; $this->db->query($sql,$station_row->station_id); } else { From 8d47e58ebbc30a6e65d833e78429defe597f3e72 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 7 Oct 2025 16:45:21 +0000 Subject: [PATCH 06/13] Duper Handling at singlepush --- application/models/Clublog_model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index bcdb26567..ed3696079 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -412,6 +412,8 @@ class Clublog_model extends CI_Model if (preg_match('/\bOK\b/', $response)) { $returner['status'] = 'OK'; + } elseif (preg_match('/\bDupe\b/', $response)) { + $returner['status'] = 'OK'; } elseif (preg_match('/\bUpdated QSO\b/', $response)) { $returner['status'] = 'OK'; } elseif (substr($response,0,14) == 'Login rejected') { // Deactivate Upload for Station if Clublog rejects it due to wrong credentials (prevent being blacklisted at Clublog) From 28f2c7ddbc01acaa6bfd881b3b627fdca37200b7 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 7 Oct 2025 17:01:34 +0000 Subject: [PATCH 07/13] Logging improved --- application/models/Clublog_model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index ed3696079..49a63c18b 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -49,6 +49,7 @@ class Clublog_model extends CI_Model $singlepush=$this->push_qso_to_clublog($clean_username, $clean_password, $station_row->station_callsign, $string, $station_id); if ($singlepush['status'] == 'OK') { $this->mark_qsos_sent($station_row->station_id); + log_message('info', 'Clublog singlepush upload for ' . $station_row->station_callsign . ' successfully sent and marked.'); } else { log_message("Error", "Singlepush for ".$station_row->station_id." / ".$station_row->station_callsign." faied: ".$singlepush['status']); } From 4936633a8d0a2df5c111021a91bdd55e5c0bdf7e Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 7 Oct 2025 17:41:07 +0000 Subject: [PATCH 08/13] Stop Download immediatly if we're victom of the ban --- application/controllers/Clublog.php | 4 ++++ application/models/Clublog_model.php | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/application/controllers/Clublog.php b/application/controllers/Clublog.php index c70930189..6c2bf0123 100644 --- a/application/controllers/Clublog.php +++ b/application/controllers/Clublog.php @@ -61,6 +61,10 @@ class Clublog extends CI_Controller if (!empty($users)) { foreach ($users as $user) { $r = $this->clublog_model->downloadUser($user->user_id, $user->user_clublog_name, $user->user_clublog_password); + if ($r == 'Impossible to reach Clublog') { // Stop Download immediatly, because we're blocked + log_message("Error","We're blocked by Clublog. Stopping Download!"); + break; + } } } else { $r = __("No user has configured Clublog."); diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 49a63c18b..7b35eaf21 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -188,10 +188,16 @@ class Clublog_model extends CI_Model curl_setopt($request, CURLOPT_TIMEOUT, 10); $response = curl_exec($request); $info = curl_getinfo($request); + $c_err=curl_errno($request); + $c_err_string=curl_error($request); curl_close($request); - if (curl_errno($request)) { - $log = curl_error($request)."
"; + if ($c_err) { + $log = $c_err_string."
"; + log_message("Error",$c_errstring."/".$c_err); + if ($c_err == 7) { // We're victim of the Clublog Firewall + return 'Impossible to reach Clublog'; + } } elseif (preg_match_all('/Login rejected/', $response)) { $this->disable_sync4call($station_row->station_callsign, $station_row->station_ids); $log = "Wrong Clublog username and password for Callsign: '" . $station_row->station_callsign . "'. 'LOGIN REJECTED'."; From 9e4804c8227c208ed0d65ef52d68287026e80ba1 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 7 Oct 2025 17:55:05 +0000 Subject: [PATCH 09/13] Typo --- application/models/Clublog_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 7b35eaf21..3274d6bdf 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -113,7 +113,7 @@ class Clublog_model extends CI_Model log_message('Error', 'Clublog upload for ' . $station_row->station_callsign . ' has become a victim of clublog-Backlog. Skipping full User for this cycle.'); unlink('uploads/clublog' . $ranid . $station_row->station_id . '.adi'); break; - } else if (preg_match('/No QSOs to upload//', $response)) { // Means: Already uploaded (but not marked) - perhaps different logtool, who knows. + } else if (preg_match('/No QSOs to upload/', $response)) { // Means: Already uploaded (but not marked) - perhaps different logtool, who knows. $this->mark_qsos_sent($station_row->station_id); $return = " Clublog upload for " . $station_row->station_callsign . ' successfully sent.'; log_message('info', 'Clublog No QSOs to upload for ' . $station_row->station_callsign . '. preventive marked.'); From 3736e8c2c935b2be99bf936a4169abb8336e1c80 Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 8 Oct 2025 04:30:31 +0000 Subject: [PATCH 10/13] Typo --- application/models/Clublog_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 3274d6bdf..bf18fe522 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -189,7 +189,7 @@ class Clublog_model extends CI_Model $response = curl_exec($request); $info = curl_getinfo($request); $c_err=curl_errno($request); - $c_err_string=curl_error($request); + $c_errstring=curl_error($request); curl_close($request); if ($c_err) { From 973a964656366585b4d4e202afba07903585786e Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 8 Oct 2025 04:33:13 +0000 Subject: [PATCH 11/13] Typo2 --- application/models/Clublog_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index bf18fe522..f8cd0c7c4 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -193,7 +193,7 @@ class Clublog_model extends CI_Model curl_close($request); if ($c_err) { - $log = $c_err_string."
"; + $log = $c_errstring."
"; log_message("Error",$c_errstring."/".$c_err); if ($c_err == 7) { // We're victim of the Clublog Firewall return 'Impossible to reach Clublog'; From f722e1cd08f050844d524482abc2c59e77ec0138 Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 8 Oct 2025 05:10:05 +0000 Subject: [PATCH 12/13] Added buildquery for Users who put specialchars in their creds --- application/models/Clublog_model.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index f8cd0c7c4..181ece779 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -180,7 +180,14 @@ class Clublog_model extends CI_Model foreach ($station_profiles->result() as $station_row) { $lastrec = $clublog_last_date ?? $this->clublog_last_qsl_rcvd_date($station_row->station_callsign); $lastrec = str_replace('-', '', $lastrec); - $url = 'https://clublog.org/getmatches.php?api=' . $this->clublog_identifier . '&email=' . $clean_username . '&password=' . $clean_password . '&callsign=' . $station_row->station_callsign . '&startyear=' . substr($lastrec, 0, 4) . '&startmonth=' . substr($lastrec, 4, 2) . '&startday=' . substr($lastrec, 6, 2); + $url_params=['api' => $this->clublog_identifier, + 'email' => $clean_username, + 'password' => $clean_password, + 'callsign' => trim($station_row->station_callsign), + 'startyear' => substr($lastrec, 0, 4), + 'startmonth' => substr($lastrec, 4, 2), + 'startday' => substr($lastrec, 6, 2)]; + $url = 'https://clublog.org/getmatches.php?' . http_build_query($url_params); $request = curl_init($url); // recieve a file From f91e4a7406794db4c299ebb734de27865251ab5a Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 8 Oct 2025 06:41:49 +0000 Subject: [PATCH 13/13] Typo (Faied --> Failed) fixed --- application/models/Clublog_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 181ece779..109bb06bd 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -51,7 +51,7 @@ class Clublog_model extends CI_Model $this->mark_qsos_sent($station_row->station_id); log_message('info', 'Clublog singlepush upload for ' . $station_row->station_callsign . ' successfully sent and marked.'); } else { - log_message("Error", "Singlepush for ".$station_row->station_id." / ".$station_row->station_callsign." faied: ".$singlepush['status']); + log_message("Error", "Singlepush for ".$station_row->station_id." / ".$station_row->station_callsign." failed: ".$singlepush['status']); } } else { $ranid = uniqid();