Quick Fixes

This commit is contained in:
JonatanRek 2020-04-24 18:37:43 +02:00
parent dec5a9083a
commit e39efd9176
2 changed files with 10 additions and 3 deletions

11
api.php
View File

@ -19,15 +19,17 @@ $files = array_diff($files, array(
'Ajax.php', 'Ajax.php',
)); ));
foreach($files as $file) { foreach($files as $file) {
include './app/class/'. $file; include './app/class/'. $file;
} }
//Allow acces only wia Curl, Ajax ETC //Allow acces only wia Curl, Ajax ETC
$restAcess = 'XMLHttpRequest' == ( $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '' ); /*$restAcess = 'XMLHttpRequest' == ( $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '' );
if (!$restAcess){ if (!$restAcess){
header('Location: ./'); header('Location: ./');
} }*/
//Log //Log
$logManager = new LogManager(); $logManager = new LogManager();
@ -215,6 +217,11 @@ if ($deviceLogs != null && $deviceLogs != ""){
die(); die();
} }
//
if (count($values) == 1){
unset($values["wifi"]);
}
// Subdevices first data! // Subdevices first data!
if ($values != null && $values != "") { if ($values != null && $values != "") {

View File

@ -91,7 +91,7 @@
url: 'ajax', url: 'ajax',
type: 'POST', type: 'POST',
//TODO: GET Attribute from ID //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){ success: function(msg){
console.log("message"); console.log("message");
console.log(msg); console.log(msg);