From 7cc72e47e8b77c975e0b3c076efbe3c2f5f26748 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 3 Dec 2017 12:24:56 -0700 Subject: [PATCH] Update provision.php --- app/provision/resources/classes/provision.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/provision/resources/classes/provision.php b/app/provision/resources/classes/provision.php index ee9e0b22c7..74ef06fbf4 100644 --- a/app/provision/resources/classes/provision.php +++ b/app/provision/resources/classes/provision.php @@ -186,6 +186,21 @@ include "root.php"; } } + //send http error + private function http_error($error) { + if ($error === "404") { + header("HTTP/1.0 404 Not Found"); + echo "\n"; + echo "404 Not Found\n"; + echo "\n"; + echo "

404 Not Found

\n"; + echo "
nginx/1.12.1
\n"; + echo "\n"; + echo "\n"; + } + exit(); + } + private function contact_append(&$contacts, &$line, $domain_uuid, $device_user_uuid, $is_group){ $sql = "select c.contact_uuid, c.contact_organization, c.contact_name_given, c.contact_name_family, "; $sql .= "c.contact_type, c.contact_category, p.phone_label,"; @@ -514,7 +529,7 @@ include "root.php"; if ($_SESSION['provision']['debug']['boolean'] == 'true'){ echo "
device disabled
"; } - echo "file not found"; + $this->http_error('404'); exit; } @@ -1228,7 +1243,7 @@ include "root.php"; $file = "{\$mac}.cfg"; } else { - echo "file not found"; + $this->http_error('404'); exit; } }