minor code cleanup

This commit is contained in:
dorian 2019-08-08 15:27:30 +02:00
parent db8b1f3074
commit a1a6b3b1ae

View file

@ -38,9 +38,10 @@ if (isset($_GET['locId'])) {
$ret = $blueweather->processSensorData($sensorData);
$data = $ret;
if ($ret['status'] !== 200) {
$log = "\n[".date("M,d,Y h:i:s A")."] ret: ".json_encode($ret)." request: ".json_encode($_POST['submitSensorData']);
$log = "\n[".date("M,d,Y h:i:s A")."] ret: ".
json_encode($ret)." request: ".json_encode($_POST['submitSensorData']);
//echo $log;
file_put_contents("./error.log" ,$log, FILE_APPEND);
file_put_contents("./error.log", $log, FILE_APPEND);
}
} elseif (isset($_GET['command'])) {
@ -52,7 +53,9 @@ if (isset($_GET['locId'])) {
switch ($request['header']) {
case 1000:
// user login
if (!isset($request['body']['username']) || !isset($request['body']['password'])) {
if (!isset($request['body']['username'])
|| !isset($request['body']['password'])
) {
$data = array("header"=>400);
} else {
$token = $blueweather->loginUser(