[API/QSO] Extends API/QSO by allowing station_profile_id to be defined

Extends API/QSO by allowing station_profile_id to be defined
这个提交包含在:
Peter Goodhall 2020-10-29 18:12:16 +00:00 提交者 GitHub
当前提交 d1a8828cd7
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23

查看文件

@ -388,7 +388,11 @@ class API extends CI_Controller {
return $arguments;
}
/*
*
* Function: QSO
* Task: allows passing of ADIF data to Cloudlog
*/
function qso() {
header('Content-type: application/json');
@ -397,12 +401,14 @@ class API extends CI_Controller {
// Decode JSON and store
$obj = json_decode(file_get_contents("php://input"), true);
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
die();
}
if($obj['type'] == "adif" && $obj['string'] != "") {
// Load the logbook model for adding QSO records
$this->load->model('logbook_model');
@ -420,8 +426,13 @@ class API extends CI_Controller {
{
break;
};
$this->logbook_model->import($record, 0, NULL, NULL, NULL);
if(isset($obj['station_profile_id'])) {
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL);
} else {
$this->logbook_model->import($record, 0, NULL, NULL, NULL);
}
};
http_response_code(201);