Api fixes
This commit is contained in:
parent
4b667540f2
commit
4da5b90b69
10
api.php
10
api.php
@ -38,7 +38,7 @@ if (DEBUGMOD != 1) {
|
||||
if (!in_array($_SERVER['REMOTE_ADDR'], HOMEIP)) {
|
||||
echo json_encode(array(
|
||||
'state' => 'unsuccess',
|
||||
'errorMSG' => "Using API from your IP insn´t alowed!",
|
||||
'errorMSG' => "Using API from your IP insnt alowed!",
|
||||
));
|
||||
header("HTTP/1.1 401 Unauthorized");
|
||||
$logManager->write("[API] acces denied from " . $_SERVER['REMOTE_ADDR'], LogRecordType::WARNING);
|
||||
@ -47,11 +47,19 @@ if (DEBUGMOD != 1) {
|
||||
}
|
||||
|
||||
//automationExecution
|
||||
try {
|
||||
AutomationManager::executeAll();
|
||||
} catch (\Exception $e) {
|
||||
$logManager->write("[Automation] Something happen during automation execution", LogRecordType::ERROR);
|
||||
}
|
||||
|
||||
//Record Cleaning
|
||||
try {
|
||||
RecordManager::clean(RECORDTIMOUT);
|
||||
} catch (\Exception $e) {
|
||||
$logManager->write("[Record] cleaning record older that" . RECORDTIMOUT , LogRecordType::ERROR);
|
||||
|
||||
}
|
||||
//Variables
|
||||
$token = $obj['token'];
|
||||
$values = null;
|
||||
|
Loading…
Reference in New Issue
Block a user