mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Prevent downloading LoTW-Reports from users who have no QSO
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user