Add a check when doing QRZ lookups to see if the session is valid, if not, create a new session and try again.

pull/694/head
Jeremy Brown 2020-11-13 10:57:48 -05:00
rodzic 064075980b
commit a5561236b1
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -2191,6 +2191,14 @@ class Logbook_model extends CI_Model {
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $use_fullname);
// if we got nothing, it's probably because our session key is invalid, try again
if (!isset($callbook['callsign']))
{
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $use_fullname);
}
}
if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {