mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Stop Download immediatly if we're victom of the ban
This commit is contained in:
@@ -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.");
|
||||
|
||||
@@ -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'.";
|
||||
|
||||
Reference in New Issue
Block a user