Skip to content

Commit fe88467

Browse files
authored
Merge pull request wavelog#2670 from phl0/fixHamqthLib
Fix hamqth lib
2 parents eb84db7 + ee07304 commit fe88467

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

application/libraries/Callbook.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,12 @@ function hamqth($username, $password, $callsign) {
125125

126126
if (!$this->ci->session->userdata('hamqth_session_key')) {
127127
$hamqth_session_key = $this->ci->hamqth->session($username, $password);
128-
$this->ci->session->set_userdata('hamqth_session_key', $hamqth_session_key);
128+
if ($hamqth_session_key == false) {
129+
$callbook['error'] = __("Error obtaining a session key for HamQTH query");
130+
return $callbook;
131+
} else {
132+
$this->ci->session->set_userdata('hamqth_session_key', $hamqth_session_key);
133+
}
129134
}
130135

131136
$callbook = $this->ci->hamqth->search($callsign, $this->ci->session->userdata('hamqth_session_key'));

application/libraries/Hamqth.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ public function session($username, $password) {
2121
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
2222
$xml = curl_exec($ch);
2323
curl_close($ch);
24+
if(curl_errno($ch)) {
25+
log_message('error', 'Hamqth query failed: '.curl_strerror(curl_errno($ch))." (".curl_errno($ch).")");
26+
return false;
27+
}
2428

2529
// Create XML object
2630
$xml = simplexml_load_string($xml);

application/views/qso/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@
893893
</div>
894894

895895
<div class="card-body callsign-image d-flex gap-3">
896-
<div class="callsign-image-content" id="callsign-image-content" style="flex-shrink: 0; max-width: 100%;">
896+
<div class="callsign-image-content" id="callsign-image-content" style="flex-shrink: 0;">
897897
</div>
898898
<div class="callsign-image-info" id="callsign-image-info" style="flex-grow: 1; min-width: 0; display: none;">
899899
</div>

assets/css/general.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ div#station_logbooks_linked_table_paginate {
647647
.callsign-image-content {
648648
display: block;
649649
max-height: 300px;
650+
max-width: 75%;
650651
text-align: center;
651652
}
652653

@@ -1417,4 +1418,4 @@ svg text.month { fill: #AAA; }
14171418
/* Ensure tooltip appears above everything */
14181419
.tooltip {
14191420
z-index: 9999 !important;
1420-
}
1421+
}

0 commit comments

Comments
 (0)