From e39efd9176229e64d9e30e2df35fa1c698c0fc62 Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Fri, 24 Apr 2020 18:37:43 +0200 Subject: [PATCH] Quick Fixes --- api.php | 11 +++++++++-- app/templates/home.phtml | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/api.php b/api.php index 8433449..97cfcfc 100644 --- a/api.php +++ b/api.php @@ -19,15 +19,17 @@ $files = array_diff($files, array( 'Ajax.php', )); + + foreach($files as $file) { include './app/class/'. $file; } //Allow acces only wia Curl, Ajax ETC -$restAcess = 'XMLHttpRequest' == ( $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '' ); +/*$restAcess = 'XMLHttpRequest' == ( $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '' ); if (!$restAcess){ header('Location: ./'); -} +}*/ //Log $logManager = new LogManager(); @@ -215,6 +217,11 @@ if ($deviceLogs != null && $deviceLogs != ""){ die(); } + +// +if (count($values) == 1){ + unset($values["wifi"]); +} // Subdevices first data! if ($values != null && $values != "") { diff --git a/app/templates/home.phtml b/app/templates/home.phtml index 59c4a24..e254fb6 100644 --- a/app/templates/home.phtml +++ b/app/templates/home.phtml @@ -91,7 +91,7 @@ url: 'ajax', type: 'POST', //TODO: GET Attribute from ID - data: { subDevice_id : '46', action : 'set', value: this.value}, + data: { subDevice_id : '13', action : 'set', value: this.value}, success: function(msg){ console.log("message"); console.log(msg);