From 8b5970630e39924081cf0ec29b97d575e7460a32 Mon Sep 17 00:00:00 2001 From: fusionate Date: Sun, 4 Jun 2023 01:46:51 +0000 Subject: [PATCH] Grandstream Wave: Updates for PHP 8.1, option to view XML data. --- app/gswave/app_config.php | 4 ++++ app/gswave/index.php | 20 +++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app/gswave/app_config.php b/app/gswave/app_config.php index de9c3193cd..aeb8b8f212 100644 --- a/app/gswave/app_config.php +++ b/app/gswave/app_config.php @@ -34,5 +34,9 @@ $apps[$x]['permissions'][$y]['name'] = "gswave_view"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "gswave_xml_view"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; ?> diff --git a/app/gswave/index.php b/app/gswave/index.php index 40220478d0..05ffa77452 100644 --- a/app/gswave/index.php +++ b/app/gswave/index.php @@ -112,6 +112,7 @@ $xml .= "*97"; $xml .= ""; $xml .= ""; + $qr_data = $xml; } @@ -144,7 +145,7 @@ echo " \n"; if (is_array($extensions) && @sizeof($extensions) != 0) { foreach ($extensions as $row) { - $selected = $row['extension_uuid'] == $extension_uuid ? "selected='selected'" : null; + $selected = !empty($extension_uuid) && $row['extension_uuid'] == $extension_uuid ? "selected='selected'" : null; echo " \n"; } } @@ -155,7 +156,7 @@ //stream the file if (!empty($extension_uuid) && is_uuid($extension_uuid)) { - $xml = html_entity_decode( $xml, ENT_QUOTES, 'UTF-8' ); + $xml = html_entity_decode($xml, ENT_QUOTES, 'UTF-8'); require_once 'resources/qr_code/QRErrorCorrectLevel.php'; require_once 'resources/qr_code/QRCode.php'; @@ -179,6 +180,19 @@ //html image if (!empty($extension_uuid) && is_uuid($extension_uuid)) { echo "\n"; + //qr data preview + if (permission_exists('gswave_xml_view')) { + echo "


\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + } } echo "\n"; @@ -186,4 +200,4 @@ //add the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file