If Clublog returns 403 disable upload

pull/3283/head
Peter Goodhall 2025-05-21 16:47:57 +01:00
rodzic 763e475a39
commit 3e24905520
2 zmienionych plików z 19 dodań i 0 usunięć

Wyświetl plik

@ -107,6 +107,14 @@ class Clublog extends CI_Controller {
} else {
echo "Error ".$response;
log_message('error', 'Clublog upload for '.$station_row->station_callsign.' failed reason '.$response);
// If Clublog responds with a 403
if ($info['http_code'] == 403) {
$this->load->model('clublog_model');
echo "Clublog API access denied for ".$station_row->station_callsign."<br>";
log_message('error', 'Clublog API access denied for '.$station_row->station_callsign);
$this->clublog_model->reset_clublog_user_fields($station_row->user_id);
}
}
// Delete the ADIF file used for clublog

Wyświetl plik

@ -17,6 +17,17 @@ class Clublog_model extends CI_Model {
return $row = $query->row_array();
}
// function to reset clublog fields for the user in the auth table
function reset_clublog_user_fields($user_id) {
$data = array(
'user_clublog_name' => null,
'user_clublog_password' => null,
);
$this->db->where('user_id', $user_id);
$this->db->update($this->config->item('auth_table'), $data);
}
function mark_qsos_sent($station_id) {
$data = array(
'COL_CLUBLOG_QSO_UPLOAD_DATE' => date('Y-m-d'),