[API][QSO] Skips check_station_is_accessible() if import is coming from API

Skips check_station_is_accessible() if import is coming from API this is because api qso import doesn't have a session thus automatically fails.

Extra checks must be done on the api calls to make sure things are safe.

Fixes #1381

Co-Authored-By: Florian (DF2ET) <github@florian-wolters.de>
pull/1383/head
Peter Goodhall 2022-01-24 16:13:25 +00:00
rodzic ab22d21b37
commit 96d7a2537d
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -450,9 +450,9 @@ class API extends CI_Controller {
if(isset($obj['station_profile_id'])) {
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, false, false);
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, false, false, true);
} else {
$this->logbook_model->import($record, 0, NULL, NULL, NULL, NULL, false, false);
$this->logbook_model->import($record, 0, NULL, NULL, NULL, NULL, false, false, true);
}
};

Wyświetl plik

@ -1879,11 +1879,11 @@ class Logbook_model extends CI_Model {
* $markQrz - used in ADIF import to mark QSOs as exported to QRZ Logbook when importing QSOs
* $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) {
function import($record, $station_id = "0", $skipDuplicate = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $skipexport = false, $operatorName = false, $apicall = false) {
// be sure that station belongs to user
$CI =& get_instance();
$CI->load->model('Stations');
if (!$CI->Stations->check_station_is_accessible($station_id)) {
if (!$CI->Stations->check_station_is_accessible($station_id) && $apicall == false ) {
return 'Station not accessible<br>';
}