diff --git a/supervisor/checker.php b/supervisor/checker.php index 934bbaa..34539fd 100755 --- a/supervisor/checker.php +++ b/supervisor/checker.php @@ -5,7 +5,7 @@ => Check if we need to turn on or turn off a device */ - require '../config/include.php'; + require __DIR__ . '/../config/include.php'; // Returns all devices that match the $time_columnName, $prog_state and $active // ==> All devices that should be activated of disactivated according to the DB diff --git a/supervisor/command.php b/supervisor/command.php index 2ce2821..ab6dddd 100755 --- a/supervisor/command.php +++ b/supervisor/command.php @@ -5,7 +5,7 @@ => Turn on or off a device */ - require '../config/include.php'; + require __DIR__ . '/../config/include.php'; $args_requiredNB = 3; // Returns all device info that match $id id @@ -46,11 +46,13 @@ function getCode($device, $origin, $command){ $values = array(); foreach($arguments as $arg){ - list($x, $y) = explode('=', $arg); - $values["$x"] = $y; + $elems = explode('=', $arg); + if(count($elems) == 2){ + $values["$elems[0]"] = $elems[1]; + } } - $nb = count($values) - 1; + $nb = count($values); } $command = $values['command']; // ON or OFF diff --git a/web/device_edit.php b/web/device_edit.php index e7ab6a1..ce9aa3e 100644 --- a/web/device_edit.php +++ b/web/device_edit.php @@ -47,9 +47,19 @@