From 9fccffd03bb55ee91382c5fd35dfd9adef838246 Mon Sep 17 00:00:00 2001 From: Velocity23 <34199284+velocity23@users.noreply.github.com> Date: Mon, 16 Aug 2021 07:55:00 +1000 Subject: [PATCH] Fix PIREP Filing Issue --- classes/controllers/PirepsController.php | 16 ---------------- classes/data/VANet.php | 6 +----- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/classes/controllers/PirepsController.php b/classes/controllers/PirepsController.php index 9741df26..bad0f800 100644 --- a/classes/controllers/PirepsController.php +++ b/classes/controllers/PirepsController.php @@ -104,22 +104,6 @@ public function post_new() $this->get_new(); } - $response = VANet::sendPirep(array( - 'aircraftLiveryId' => Aircraft::idToLiveryId(Input::get('aircraft')), - 'arrivalIcao' => strtoupper(Input::get('arr')), - 'date' => Input::get('date'), - 'departureIcao' => strtoupper(Input::get('dep')), - 'flightTime' => Time::strToSecs(Input::get('ftime')), - 'fuelUsed' => Input::get('fuel'), - 'pilotId' => $user->data()->ifuserid - )); - - if (!$response) { - Session::flash('error', 'There was an Error Connecting to VANet.'); - $this->get_new(); - die(); - } - if (!Pirep::file(array( 'flightnum' => Input::get('fnum'), 'departure' => strtoupper(Input::get('dep')), diff --git a/classes/data/VANet.php b/classes/data/VANet.php index c0199015..62673391 100644 --- a/classes/data/VANet.php +++ b/classes/data/VANet.php @@ -185,12 +185,8 @@ public static function sendPirep($ev) $response = Json::decode(@HttpRequest::hacky(self::baseUrl() . "/airline/v1/flights", "POST", $data, ["X-Api-Key: {$key}", "Content-Type: application/json"])); if (!$response || $response['status'] != 0) { - return false; + die('Error Connecting to VANet'); } - - if (!$response || $response['status'] != 0) return false; - - return true; } /**