minor code cleanup
This commit is contained in:
parent
db8b1f3074
commit
a1a6b3b1ae
1 changed files with 6 additions and 3 deletions
|
@ -38,9 +38,10 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif (isset($_GET['command'])) {
|
} elseif (isset($_GET['command'])) {
|
||||||
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue