From cefa732b66285db7b6b4f7dcb64acda5bf489c6c Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 10 Jan 2024 06:12:23 +0000 Subject: [PATCH] Added "DryRun" (per default disabled) to QSO-API, to make API more debugable --- application/controllers/Api.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 6a9a43408..840f5b3a5 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -157,7 +157,7 @@ class API extends CI_Controller { * Function: QSO * Task: allows passing of ADIF data to Cloudlog */ - function qso() { + function qso($dryrun = false) { header('Content-type: application/json'); $this->load->model('api_model'); @@ -207,7 +207,7 @@ class API extends CI_Controller { }; - if(isset($obj['station_profile_id'])) { + if( !($dryrun) && (isset($obj['station_profile_id']))) { if(isset($record['station_callsign']) && $this->stations->check_station_against_callsign($obj['station_profile_id'], $record['station_callsign']) == false) { http_response_code(401); echo json_encode(['status' => 'failed', 'reason' => "station callsign does not match station callsign in station profile."]); @@ -229,6 +229,8 @@ class API extends CI_Controller { } else { $return_msg[] = $msg; } + } else { + $return_msg[]='Dryrun works'; } };