mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Add Username and ID to hash. ID to MQTT-Topic
This commit is contained in:
@@ -444,8 +444,16 @@ class Logbook_model extends CI_Model {
|
||||
}
|
||||
|
||||
$this->add_qso($data, $skipexport = false);
|
||||
$this->load->model('stations');
|
||||
$this->load->library('Mh');
|
||||
$this->mh->wl_event('qso/logged/'.$this->session->userdata('user_id'), json_encode($data));
|
||||
$h_user=$this->stations->get_user_from_station($station_id);
|
||||
$event_data=$data;
|
||||
$event_data['user_name']=$h_user->user_name;
|
||||
$event_data['user_id']=$h_user->user_id;
|
||||
$this->mh->wl_event('qso/logged/'.($h_user->user_id ?? ''), json_encode($event_data));
|
||||
unset($event_data);
|
||||
unset($h_user);
|
||||
unset($data);
|
||||
}
|
||||
|
||||
public function check_last_lotw($call) { // Fetch difference in days when $call has last updated LotW
|
||||
@@ -4596,8 +4604,15 @@ class Logbook_model extends CI_Model {
|
||||
}
|
||||
|
||||
if ($apicall) {
|
||||
$this->load->model('stations');
|
||||
$this->load->library('Mh');
|
||||
$this->mh->wl_event('qso/logged/api/'.($this->session->userdata('user_id') ?? 'API'), json_encode($data));
|
||||
$h_user=$this->stations->get_user_from_station($station_id);
|
||||
$event_data=$data;
|
||||
$event_data['user_name']=($h_user->user_name ?? '');
|
||||
$event_data['user_id']=($h_user->user_id ?? '');
|
||||
$this->mh->wl_event('qso/logged/api/'.($h_user->user_id ?? ''), json_encode($event_data));
|
||||
unset($event_data);
|
||||
unset($h_user);
|
||||
}
|
||||
// Save QSO
|
||||
if ($batchmode) {
|
||||
|
||||
@@ -570,6 +570,16 @@ class Stations extends CI_Model {
|
||||
}
|
||||
}
|
||||
|
||||
public function get_user_from_station($stationid) {
|
||||
if (($stationid ?? '') != '') {
|
||||
$sql="select u.* from users u inner join station_profile sp on (u.user_id=sp.user_id) where sp.station_id = ?";
|
||||
$query = $this->db->query($sql, $stationid);
|
||||
return $query->row();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function check_station_against_user($stationid, $userid) {
|
||||
$this->db->select('station_id');
|
||||
$this->db->where('user_id', $userid);
|
||||
|
||||
Reference in New Issue
Block a user