From 4936633a8d0a2df5c111021a91bdd55e5c0bdf7e Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 7 Oct 2025 17:41:07 +0000 Subject: [PATCH] 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'.";