Api fix http code on home enter #2
This commit is contained in:
parent
c1fc666815
commit
d08bfa8018
8
api.php
8
api.php
@ -25,14 +25,18 @@ $obj = json_decode($json, true);
|
|||||||
//zabespecit proti Ddosu
|
//zabespecit proti Ddosu
|
||||||
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']);
|
||||||
|
if (!empty($user)) {
|
||||||
$userId = $user['user_id'];
|
$userId = $user['user_id'];
|
||||||
$keyWords = ['entered', 'connected', 'connected to', 'true'];
|
if (is_bool($obj['atHome'])){
|
||||||
UserManager::atHome($userId, $obj['atHome']);
|
UserManager::atHome($userId, $obj['atHome'] ? 'true' : 'false');
|
||||||
echo 'Saved';
|
echo 'Saved';
|
||||||
header("HTTP/1.1 200 OK");
|
header("HTTP/1.1 200 OK");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Filtrování IP adress
|
//Filtrování IP adress
|
||||||
if (DEBUGMOD != 1) {
|
if (DEBUGMOD != 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user