Prevent downloading LoTW-Reports from users who have no QSO

This commit is contained in:
int2001
2026-02-17 14:46:23 +00:00
parent b6b207fb81
commit 48958b165d
2 changed files with 6 additions and 3 deletions

View File

@@ -4703,12 +4703,15 @@ class Logbook_model extends CI_Model {
}
function lotw_last_qsl_date($user_id) {
$sql = "SELECT MAX(COALESCE(COL_LOTW_QSLRDATE, '1900-01-01 00:00:00')) MAXDATE
$sql = "SELECT MAX(COALESCE(COL_LOTW_QSLRDATE, '1900-01-01 00:00:00')) MAXDATE, COUNT(1) as QSOS
FROM " . $this->config->item('table_name') . " INNER JOIN station_profile ON (" . $this->config->item('table_name') . ".station_id = station_profile.station_id)
WHERE station_profile.user_id=" . $user_id . " and COL_LOTW_QSLRDATE is not null";
WHERE station_profile.user_id=" . $user_id;
$query = $this->db->query($sql);
$row = $query->row();
if ($row->QSOS == 0) {
return '2100-01-01 00:00:00.000'; // No QSO in Log, set since to future, otherwise this user blocks download
}
if ($row->MAXDATE != null) {
return $row->MAXDATE;
}

View File

@@ -50,7 +50,7 @@ class User_Model extends CI_Model {
// Returns all users with lotw details
function get_all_lotw_users() {
$this->db->where('user_lotw_name !=', null);
$this->db->where('user_lotw_name !=', "");
$this->db->where('trim(user_lotw_name) !=', "");
$r = $this->db->get($this->config->item('auth_table'));
return $r;
}