Some tweeks
This commit is contained in:
parent
801e26dda9
commit
24072cb582
5
api.php
5
api.php
@ -47,11 +47,14 @@ if (defined(DEBUGMOD) && DEBUGMOD == 1) {
|
|||||||
if (isset($obj['user']) && $obj['user'] != ''){
|
if (isset($obj['user']) && $obj['user'] != ''){
|
||||||
//user at home
|
//user at home
|
||||||
$user = UserManager::getUser($obj['user']);
|
$user = UserManager::getUser($obj['user']);
|
||||||
|
$userAtHome = $user['atHome'];
|
||||||
if (!empty($user)) {
|
if (!empty($user)) {
|
||||||
$userId = $user['user_id'];
|
$userId = $user['user_id'];
|
||||||
$atHome = $obj['atHome'];
|
$atHome = $obj['atHome'];
|
||||||
|
if($userAtHome != $atHome){
|
||||||
UserManager::atHome($userId, $atHome);
|
UserManager::atHome($userId, $atHome);
|
||||||
$logManager->write("[Record] user " . $userId . " changet his home state to " . $atHome . " " . RECORDTIMOUT , LogRecordType::INFO);
|
$logManager->write("[USER] user " . $userId . " changet his home state to " . $atHome , LogRecordType::INFO);
|
||||||
|
}
|
||||||
echo 'Saved: ' . $atHome;
|
echo 'Saved: ' . $atHome;
|
||||||
header($_SERVER["SERVER_PROTOCOL"]." 200 OK");
|
header($_SERVER["SERVER_PROTOCOL"]." 200 OK");
|
||||||
die();
|
die();
|
||||||
|
Loading…
Reference in New Issue
Block a user