Some tweeks

This commit is contained in:
JonatanRek 2020-03-16 15:07:44 +01:00
parent 801e26dda9
commit 24072cb582

View File

@ -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'];
UserManager::atHome($userId, $atHome); if($userAtHome != $atHome){
$logManager->write("[Record] user " . $userId . " changet his home state to " . $atHome . " " . RECORDTIMOUT , LogRecordType::INFO); UserManager::atHome($userId, $atHome);
$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();