From a62cafb40292a49f5fb0c4944791f74730742027 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Thu, 3 Dec 2015 10:29:33 -0700 Subject: [PATCH] Update the provision file download to work with domain filter set to false. --- app/devices/device_edit.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 6039ea02bb..e7064dfeb6 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -547,7 +547,13 @@ require_once "resources/require.php"; echo " function download(d) {\n"; echo " if (d == '".$text['label-download']."') return;\n"; - echo " window.location = 'https://".$_SESSION['domain_name']."/app/provision?mac=$device_mac_address&file=' + d + '&content_type=application/octet-stream';\n"; + if ($_SESSION['provision']['http_domain_filter']['text'] == "false") { + $domain_name = $_SERVER["HTTP_HOST"]; + } + else { + $domain_name = $_SESSION['domain_name']; + } + echo " window.location = 'https://".$domain_name."/app/provision?mac=$device_mac_address&file=' + d + '&content_type=application/octet-stream';\n"; echo " }\n"; echo "\n";