From c3f4d8a1c231e93f3632094da882fe75e07960e6 Mon Sep 17 00:00:00 2001 From: fusionate Date: Mon, 3 Jul 2023 19:52:56 +0000 Subject: [PATCH] Device - Edit: Include provisioning htt_auth creds (if enabled) in Linphone QR code. --- app/devices/device_edit.php | 47 +++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 181ddda102..bd9f94b35f 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -806,8 +806,15 @@ //build content for linphone if ($device_template == "linphone/default") { - $content = "https://".$_SESSION['domain_name'].'/app/provision/index.php?address='.$device_address; - //$content = "https://".$_SESSION['domain_name'].'/'.$device_address.'.xml'; + if ( + !empty($_SESSION['provision']['http_auth_enabled']['boolean']) && + $_SESSION['provision']['http_auth_enabled']['boolean'] == 'true' && + !empty($_SESSION['provision']['http_auth_username']['text']) && + !empty($_SESSION['provision']['http_auth_password'][0]) + ) { + $auth_string = $_SESSION['provision']['http_auth_username']['text'].':'.$_SESSION['provision']['http_auth_password'][0].'@'; + } + $content = "https://".$auth_string.$_SESSION['domain_name'].'/app/provision/index.php?address='.$device_address; } //stream the file @@ -836,52 +843,46 @@ //html image if (!empty($content) && !empty($image)) { echo "\n"; echo "\n"; echo ""; - echo "
\n"; - echo " \n"; + echo "
\n"; + echo " \n"; echo "
\n"; } /*