Stop Download immediatly if we're victom of the ban

This commit is contained in:
int2001
2025-10-07 17:41:07 +00:00
parent 28f2c7ddbc
commit 4936633a8d
2 changed files with 12 additions and 2 deletions

View File

@@ -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.");

View File

@@ -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)."<br>";
if ($c_err) {
$log = $c_err_string."<br>";
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'.";