diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php
index eb789d6d..5ebe2826 100644
--- a/application/controllers/Adif.php
+++ b/application/controllers/Adif.php
@@ -144,7 +144,7 @@ class adif extends CI_Controller {
$data['page_title'] = "ADIF Import / Export";
$data['max_upload'] = ini_get('upload_max_filesize');
- $data['station_profile'] = $this->stations->all();
+ $data['station_profile'] = $this->stations->all_of_user();
$active_station_id = $this->stations->find_active();
$station_profile = $this->stations->profile($active_station_id);
@@ -157,7 +157,7 @@ class adif extends CI_Controller {
public function import() {
$this->load->model('stations');
- $data['station_profile'] = $this->stations->all();
+ $data['station_profile'] = $this->stations->all_of_user();
$active_station_id = $this->stations->find_active();
$station_profile = $this->stations->profile($active_station_id);
diff --git a/application/models/Adif_data.php b/application/models/Adif_data.php
index 40bfacef..4449a671 100644
--- a/application/models/Adif_data.php
+++ b/application/models/Adif_data.php
@@ -68,6 +68,13 @@ class adif_data extends CI_Model {
}
function export_custom($from, $to, $station_id, $exportLotw = false) {
+ // be sure that station belongs to user
+ $CI =& get_instance();
+ $CI->load->model('Stations');
+ if (!$CI->Stations->check_station_is_accessible($station_id)) {
+ return;
+ }
+
$this->db->select(''.$this->config->item('table_name').'.*, station_profile.*');
$this->db->from($this->config->item('table_name'));
$this->db->where($this->config->item('table_name').'.station_id', $station_id);
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index 94961fbc..b89d716a 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -1751,6 +1751,13 @@ class Logbook_model extends CI_Model {
* $skipexport - used in ADIF import to skip the realtime upload to QRZ Logbook when importing QSOs from ADIF
*/
function import($record, $station_id = "0", $skipDuplicate = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $skipexport = false, $operatorName = false) {
+ // be sure that station belongs to user
+ $CI =& get_instance();
+ $CI->load->model('Stations');
+ if (!$CI->Stations->check_station_is_accessible($station_id)) {
+ return 'Station not accessible
';
+ }
+
$CI =& get_instance();
$CI->load->library('frequency');
$my_error = "";
diff --git a/application/views/adif/import.php b/application/views/adif/import.php
index 33b97b8e..6b42c7fb 100644
--- a/application/views/adif/import.php
+++ b/application/views/adif/import.php
@@ -32,7 +32,7 @@