From 8090d97dac461f51875b74476beba13b32a74461 Mon Sep 17 00:00:00 2001 From: int2001 Date: Sun, 2 Jun 2024 10:20:22 +0000 Subject: [PATCH 1/5] Deactivate Clublog-Upload for station if it is rejected (prevent blacklisting) --- application/models/Clublog_model.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 326121fc6..7502ce252 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -101,6 +101,10 @@ class Clublog_model extends CI_Model } else { $return = "Error " . $response; log_message('error', 'Clublog upload for ' . $station_row->station_callsign . ' failed reason ' . $response); + if (substr($response,0,13) == 'Upload denied') { // Deactivate Upload for Station if Clublog rejects it (prevent being blacklisted at Clublog) + $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; + $this->db->query($sql,$station_row->station_id); + } } // Delete the ADIF file used for clublog From 66dea839ba34dca2086bd47cd5b86a64fbe65c1d Mon Sep 17 00:00:00 2001 From: int2001 Date: Sun, 2 Jun 2024 10:21:45 +0000 Subject: [PATCH 2/5] Reformat so files fits into rest of project-structure --- application/models/Clublog_model.php | 36 ++++++++++------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 7502ce252..c0bcfff26 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -3,8 +3,7 @@ class Clublog_model extends CI_Model { - function get_clublog_users() - { + function get_clublog_users() { $this->db->select('user_clublog_name, user_clublog_password, user_id'); $this->db->where('coalesce(user_clublog_name, "") != ""'); $this->db->where('coalesce(user_clublog_password, "") != ""'); @@ -12,8 +11,7 @@ class Clublog_model extends CI_Model return $query->result(); } - function uploadUser($userid, $username, $password) - { + function uploadUser($userid, $username, $password) { $clean_username = $this->security->xss_clean($username); $clean_passord = $this->security->xss_clean($password); $clean_userid = $this->security->xss_clean($userid); @@ -122,8 +120,7 @@ class Clublog_model extends CI_Model return $return . "\n"; } - function downloadUser($userid, $username, $password) - { + function downloadUser($userid, $username, $password) { $clean_username = $this->security->xss_clean($username); $clean_password = $this->security->xss_clean($password); $clean_userid = $this->security->xss_clean($userid); @@ -183,8 +180,7 @@ class Clublog_model extends CI_Model return $return . "\n"; } - function mark_qsos_sent($station_id) - { + function mark_qsos_sent($station_id) { $data = array( 'COL_CLUBLOG_QSO_UPLOAD_DATE' => date('Y-m-d'), 'COL_CLUBLOG_QSO_UPLOAD_STATUS' => "Y", @@ -200,8 +196,7 @@ class Clublog_model extends CI_Model $this->db->update($this->config->item('table_name'), $data); } - function mark_qso_sent($qso_id) - { + function mark_qso_sent($qso_id) { $data = array( 'COL_CLUBLOG_QSO_UPLOAD_DATE' => date('Y-m-d'), 'COL_CLUBLOG_QSO_UPLOAD_STATUS' => "Y", @@ -211,8 +206,7 @@ class Clublog_model extends CI_Model $this->db->update($this->config->item('table_name'), $data); } - function get_last_five($station_id) - { + function get_last_five($station_id) { $this->db->where('station_id', $station_id); $this->db->group_start(); $this->db->where("COL_CLUBLOG_QSO_UPLOAD_STATUS", null); @@ -225,8 +219,7 @@ class Clublog_model extends CI_Model return $query; } - function mark_all_qsos_notsent($station_id) - { + function mark_all_qsos_notsent($station_id) { $data = array( 'COL_CLUBLOG_QSO_UPLOAD_DATE' => null, 'COL_CLUBLOG_QSO_UPLOAD_STATUS' => "M", @@ -238,8 +231,7 @@ class Clublog_model extends CI_Model $this->db->update($this->config->item('table_name'), $data); } - function get_clublog_qsos($station_id) - { + function get_clublog_qsos($station_id) { $this->db->select('*, dxcc_entities.name as station_country'); $this->db->join('station_profile', 'station_profile.station_id = ' . $this->config->item('table_name') . '.station_id'); $this->db->join('dxcc_entities', 'station_profile.station_dxcc = dxcc_entities.adif', 'left outer'); @@ -257,8 +249,7 @@ class Clublog_model extends CI_Model return $query; } - function clublog_last_qsl_rcvd_date($callsign) - { + function clublog_last_qsl_rcvd_date($callsign) { $qso_table_name = $this->config->item('table_name'); $this->db->from($qso_table_name); @@ -283,14 +274,12 @@ class Clublog_model extends CI_Model } } - function disable_sync4call($call, $stations) - { + function disable_sync4call($call, $stations) { $sql = "update station_profile set clublogignore=1 where station_callsign=? and station_id in (" . $stations . ")"; $query = $this->db->query($sql, $call); } - function all_enabled($userid) - { + function all_enabled($userid) { $sql = "select sp.station_callsign, group_concat(sp.station_id) as station_ids from station_profile sp inner join users u on (u.user_id=sp.user_id) where u.user_clublog_name is not null and u.user_clublog_password is not null and sp.clublogignore=0 and u.user_id=? @@ -299,8 +288,7 @@ class Clublog_model extends CI_Model return $query; } - function all_with_count($userid) - { + function all_with_count($userid) { $this->db->select('station_profile.station_id, station_profile.station_callsign, count(' . $this->config->item('table_name') . '.station_id) as qso_total'); $this->db->from('station_profile'); $this->db->join($this->config->item('table_name'), 'station_profile.station_id = ' . $this->config->item('table_name') . '.station_id', 'left'); From c9715730a7279ad67eeef8d00a75f44239ffa278 Mon Sep 17 00:00:00 2001 From: int2001 Date: Sun, 2 Jun 2024 11:20:01 +0000 Subject: [PATCH 3/5] Added hint for auto-deactivation to ger/eng lang --- application/language/english/station_lang.php | 2 +- application/language/german/station_lang.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/language/english/station_lang.php b/application/language/english/station_lang.php index 9971681d8..633d7797c 100644 --- a/application/language/english/station_lang.php +++ b/application/language/english/station_lang.php @@ -114,5 +114,5 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/german/station_lang.php b/application/language/german/station_lang.php index 39762882e..1dd412385 100644 --- a/application/language/german/station_lang.php +++ b/application/language/german/station_lang.php @@ -114,5 +114,5 @@ $lang['station_location_oqrs_email_hint'] = "Stelle sicher, dass du E-Mail unter $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Einige Informationen, die du zum QSL-Vorgang hinzufügen möchtest."; $lang['station_location_ignore'] = "Ignoriere Clublog-Upload"; -$lang['station_location_ignore_hint'] = "Wenn aktiviert, werden die QSOs, die von diesem Standort gemacht wurden, beim Clublog-Upload ignoriert."; +$lang['station_location_ignore_hint'] = "Wenn aktiviert, werden die QSOs, die von diesem Standort gemacht wurden, beim Clublog-Upload ignoriert.
Sofern das Feld \"von allein\" auf deaktiviert springt, bitte bei Clublog die Einstellungen für diesen Call überprüfen"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; From b0d8bc92996cd6d8577934b85b4d249a5050a446 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 3 Jun 2024 14:05:17 +0200 Subject: [PATCH 4/5] rest of lang files --- application/language/bulgarian/station_lang.php | 2 +- application/language/chinese_simplified/station_lang.php | 2 +- application/language/czech/station_lang.php | 2 +- application/language/dutch/station_lang.php | 2 +- application/language/finnish/station_lang.php | 2 +- application/language/french/station_lang.php | 2 +- application/language/german/station_lang.php | 2 +- application/language/greek/station_lang.php | 2 +- application/language/italian/station_lang.php | 2 +- application/language/polish/station_lang.php | 2 +- application/language/russian/station_lang.php | 2 +- application/language/spanish/station_lang.php | 2 +- application/language/swedish/station_lang.php | 2 +- application/language/turkish/station_lang.php | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/application/language/bulgarian/station_lang.php b/application/language/bulgarian/station_lang.php index b52282ff6..3dd0382f3 100644 --- a/application/language/bulgarian/station_lang.php +++ b/application/language/bulgarian/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/chinese_simplified/station_lang.php b/application/language/chinese_simplified/station_lang.php index c9fafa1d9..0b327e36f 100644 --- a/application/language/chinese_simplified/station_lang.php +++ b/application/language/chinese_simplified/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "确认邮件功能在站点设置 $lang['station_location_oqrs_text'] = "OQRS 文本"; $lang['station_location_oqrs_text_hint'] = "QSL 信息"; $lang['station_location_ignore'] = "忽略 Clublog 上传"; -$lang['station_location_ignore_hint'] = "如启用,此台站产生的 QSO 不会上传至 Clublog"; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog 实时上传'; diff --git a/application/language/czech/station_lang.php b/application/language/czech/station_lang.php index b52282ff6..3dd0382f3 100644 --- a/application/language/czech/station_lang.php +++ b/application/language/czech/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/dutch/station_lang.php b/application/language/dutch/station_lang.php index b52282ff6..3dd0382f3 100644 --- a/application/language/dutch/station_lang.php +++ b/application/language/dutch/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/finnish/station_lang.php b/application/language/finnish/station_lang.php index b52282ff6..3dd0382f3 100644 --- a/application/language/finnish/station_lang.php +++ b/application/language/finnish/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/french/station_lang.php b/application/language/french/station_lang.php index 6ef1cb164..a3f47e83b 100644 --- a/application/language/french/station_lang.php +++ b/application/language/french/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/german/station_lang.php b/application/language/german/station_lang.php index 1dd412385..70b2f83df 100644 --- a/application/language/german/station_lang.php +++ b/application/language/german/station_lang.php @@ -114,5 +114,5 @@ $lang['station_location_oqrs_email_hint'] = "Stelle sicher, dass du E-Mail unter $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Einige Informationen, die du zum QSL-Vorgang hinzufügen möchtest."; $lang['station_location_ignore'] = "Ignoriere Clublog-Upload"; -$lang['station_location_ignore_hint'] = "Wenn aktiviert, werden die QSOs, die von diesem Standort gemacht wurden, beim Clublog-Upload ignoriert.
Sofern das Feld \"von allein\" auf deaktiviert springt, bitte bei Clublog die Einstellungen für diesen Call überprüfen"; +$lang['station_location_ignore_hint'] = "Wenn aktiviert, werden die QSOs, die von diesem Standort gemacht wurden, beim Clublog-Upload ignoriert.
Sofern das Feld \"von allein\" auf deaktiviert springt, bitte bei Clublog die Einstellungen für diesen Call überprüfen."; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/greek/station_lang.php b/application/language/greek/station_lang.php index b52282ff6..3dd0382f3 100644 --- a/application/language/greek/station_lang.php +++ b/application/language/greek/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/italian/station_lang.php b/application/language/italian/station_lang.php index b52282ff6..3dd0382f3 100644 --- a/application/language/italian/station_lang.php +++ b/application/language/italian/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/polish/station_lang.php b/application/language/polish/station_lang.php index b52282ff6..3dd0382f3 100644 --- a/application/language/polish/station_lang.php +++ b/application/language/polish/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/russian/station_lang.php b/application/language/russian/station_lang.php index 8e9a1d8b5..2fae99f5b 100644 --- a/application/language/russian/station_lang.php +++ b/application/language/russian/station_lang.php @@ -114,5 +114,5 @@ $lang['station_location_oqrs_email_hint'] = "Убедитесь, что емэй $lang['station_location_oqrs_text'] = "Текст OQRS"; $lang['station_location_oqrs_text_hint'] = "Информация, которую вы хотите добавить, касающаяся QSL."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/spanish/station_lang.php b/application/language/spanish/station_lang.php index b534540cc..e17a9fb23 100644 --- a/application/language/spanish/station_lang.php +++ b/application/language/spanish/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Asegúrese que su correo está bien $lang['station_location_oqrs_text'] = "Texto OQRS"; $lang['station_location_oqrs_text_hint'] = "Algúna información que desee agregar acerca de su forma de hacer QSL."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='Subida en Tiempo Real en ClubLog'; diff --git a/application/language/swedish/station_lang.php b/application/language/swedish/station_lang.php index b52282ff6..3dd0382f3 100644 --- a/application/language/swedish/station_lang.php +++ b/application/language/swedish/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; diff --git a/application/language/turkish/station_lang.php b/application/language/turkish/station_lang.php index b52282ff6..3dd0382f3 100644 --- a/application/language/turkish/station_lang.php +++ b/application/language/turkish/station_lang.php @@ -114,7 +114,7 @@ $lang['station_location_oqrs_email_hint'] = "Make sure email is set up under adm $lang['station_location_oqrs_text'] = "OQRS Text"; $lang['station_location_oqrs_text_hint'] = "Some info you want to add regarding QSL'ing."; $lang['station_location_ignore'] = "Ignore Clublog Upload"; -$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog."; +$lang['station_location_ignore_hint'] = "If enabled, the QSOs made from this location will not be uploaded to Clublog. If this is deactivated on it's own please check if the Call is properly configured at Clublog"; $lang['station_location_clublog_realtime_upload']='ClubLog Realtime Upload'; From be23c0293093db6d10d989150cc19399dfdae507 Mon Sep 17 00:00:00 2001 From: int2001 Date: Mon, 3 Jun 2024 14:28:10 +0000 Subject: [PATCH 5/5] Added rejection-case for wrong-credentials --- 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 c0bcfff26..024131ccf 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -99,7 +99,11 @@ class Clublog_model extends CI_Model } else { $return = "Error " . $response; log_message('error', 'Clublog upload for ' . $station_row->station_callsign . ' failed reason ' . $response); - if (substr($response,0,13) == 'Upload denied') { // Deactivate Upload for Station if Clublog rejects it (prevent being blacklisted at Clublog) + 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) + $sql = 'update station_profile set clublogignore = 1 where station_id = ?'; + $this->db->query($sql,$station_row->station_id); + } + if (substr($response,0,14) == 'Login rejected') { // Deactivate Upload for Station if Clublog rejects it 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); }