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'.";