minor code cleanup
This commit is contained in:
parent
db8b1f3074
commit
a1a6b3b1ae
1 changed files with 6 additions and 3 deletions
|
@ -38,7 +38,8 @@ 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);
|
||||
}
|
||||
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue