minor code cleanup

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

View file

@ -38,7 +38,8 @@ if (isset($_GET['locId'])) {
$ret = $blueweather->processSensorData($sensorData); $ret = $blueweather->processSensorData($sensorData);
$data = $ret; $data = $ret;
if ($ret['status'] !== 200) { 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; //echo $log;
file_put_contents("./error.log", $log, FILE_APPEND); file_put_contents("./error.log", $log, FILE_APPEND);
} }
@ -52,7 +53,9 @@ if (isset($_GET['locId'])) {
switch ($request['header']) { switch ($request['header']) {
case 1000: case 1000:
// user login // user login
if (!isset($request['body']['username']) || !isset($request['body']['password'])) { if (!isset($request['body']['username'])
|| !isset($request['body']['password'])
) {
$data = array("header"=>400); $data = array("header"=>400);
} else { } else {
$token = $blueweather->loginUser( $token = $blueweather->loginUser(