[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>
这个提交包含在:
父节点
ab22d21b37
当前提交
96d7a2537d
共有 2 个文件被更改,包括 4 次插入 和 4 次删除
|
|
@ -450,9 +450,9 @@ class API extends CI_Controller {
|
||||||
|
|
||||||
|
|
||||||
if(isset($obj['station_profile_id'])) {
|
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 {
|
} 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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
|
* $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
|
* $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
|
// be sure that station belongs to user
|
||||||
$CI =& get_instance();
|
$CI =& get_instance();
|
||||||
$CI->load->model('Stations');
|
$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>';
|
return 'Station not accessible<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用