Fixed correct return of error

This commit is contained in:
Andreas Kristiansen
2024-11-25 10:34:11 +01:00
parent 778eab18d9
commit eb70e66b32
2 changed files with 7 additions and 4 deletions

View File

@@ -21,19 +21,22 @@ class Callbook {
switch ($this->ci->config->item('callbook')) {
case 'qrz':
if ($this->ci->config->item('qrz_username') == null || $this->ci->config->item('qrz_password') == null) {
return 'Lookup not configured. Please review configuration.';
$callbook['error'] = 'Lookup not configured. Please review configuration.';
return $callbook;
}
return $this->qrz($this->ci->config->item('qrz_username'), $this->ci->config->item('qrz_password'), $callsign, $this->ci->config->item('use_fullname'));
break;
case 'qrzcq':
if ($this->ci->config->item('qrzcq_username') == null || $this->ci->config->item('qrzcq_password') == null) {
return 'Lookup not configured. Please review configuration.';
$callbook['error'] = 'Lookup not configured. Please review configuration.';
return $callbook;
}
return $this->qrzcq($this->ci->config->item('qrzcq_username'), $this->ci->config->item('qrzcq_password'), $callsign);
break;
case 'hamqth':
if ($this->ci->config->item('hamqth_username') == null || $this->ci->config->item('hamqth_password') == null) {
return 'Lookup not configured. Please review configuration.';
$callbook['error'] = 'Lookup not configured. Please review configuration.';
return $callbook;
}
return $this->hamqth($this->ci->config->item('hamqth_username'), $this->ci->config->item('hamqth_password'), $callsign);
break;

View File

@@ -55,7 +55,7 @@ class Qrzcq {
$key = (string) $xml->Session->Key;
$ci->session->set_userdata('qrz_session_key', $key);
$ci->session->set_userdata('qrzcq_session_key', $key);
return true;
}