Apy TODO coment
This commit is contained in:
parent
a7f59fb609
commit
90f1bf58bf
8
api.php
8
api.php
@ -18,18 +18,20 @@ Db::connect (DBHOST, DBUSER, DBPASS, DBNAME);
|
|||||||
$json = file_get_contents('php://input');
|
$json = file_get_contents('php://input');
|
||||||
$obj = json_decode($json, true);
|
$obj = json_decode($json, true);
|
||||||
|
|
||||||
|
|
||||||
|
//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']);
|
||||||
$userId = $user['user_id'];
|
$userId = $user['user_id'];
|
||||||
$keyWords = ['entered', 'connected', 'connected to'];
|
$keyWords = ['entered', 'connected', 'connected to'];
|
||||||
UserManager::atHome($userId, $obj['atHome']);
|
UserManager::atHome($userId, $obj['atHome']);
|
||||||
echo 'ssaved';
|
echo 'saved';
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Filtrování IP adress
|
//Filtrování IP adress
|
||||||
/*if (DEBUGMOD != 1) {
|
if (DEBUGMOD != 1) {
|
||||||
if (!in_array($_SERVER['REMOTE_ADDR'], HOMEIP)) {
|
if (!in_array($_SERVER['REMOTE_ADDR'], HOMEIP)) {
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
'state' => 'unsuccess',
|
'state' => 'unsuccess',
|
||||||
@ -38,7 +40,7 @@ if (isset($obj['user']) && $obj['user'] != ''){
|
|||||||
header("HTTP/1.1 401 Unauthorized");
|
header("HTTP/1.1 401 Unauthorized");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
//automationExecution
|
//automationExecution
|
||||||
AutomationManager::executeAll();
|
AutomationManager::executeAll();
|
||||||
|
Loading…
Reference in New Issue
Block a user