From c1df80bf555874dd3fe251955999de4b073494a6 Mon Sep 17 00:00:00 2001 From: christian1180 <126362145+christian1180@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:23:45 +0100 Subject: [PATCH] sysvarpin angepasst. sysvarpin angepasst. --- custom/components/sysvarpin.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/custom/components/sysvarpin.php b/custom/components/sysvarpin.php index 81e9163..acb70e4 100644 --- a/custom/components/sysvarpin.php +++ b/custom/components/sysvarpin.php @@ -19,7 +19,19 @@ function sysvarpin($component) { - global $interface; +// definiere Interface + + global $_SERVER; + global $ccu; + + $interface = $_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].str_replace("index.php", "",$_SERVER['PHP_SELF']); +if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { + $interface = "https://".$interface; +} +else $interface = "http://".$interface; + + +//echo "###".$interface."###"; if (isset($component['ise_id'])) { $modalId = mt_rand(); require("config/config.php"); @@ -27,9 +39,14 @@ function sysvarpin($component) { $xmlFile = 'dev/sysvar.php?ise_id='.$component['ise_id']; } else { $xmlFile = $interface.'/interface.php?sysvar.cgi&ise_id='.$component['ise_id']; + //$xmlFile = 'interface.php?sysvar.cgi&ise_id='.$component['ise_id']; + //echo $xmlFile; } $xml = simplexml_load_file($xmlFile); + // $xml = simplexml_load_string(api_state($ccu, $component['ise_id'], true)); + //print_r($xml); + foreach ($xml->systemVariable as $states) {