BACKGROUND SINC

This commit is contained in:
JonatanRek 2020-02-13 17:39:58 +01:00
parent f0e82de775
commit 0b8ad755a0
3 changed files with 58 additions and 51 deletions

View File

@ -38,8 +38,7 @@ Db::connect (DBHOST, DBUSER, DBPASS, DBNAME);
//Read API data //Read API data
$json = file_get_contents('php://input'); $json = file_get_contents('php://input');
$obj = json_decode($json, true); $obj = json_decode($json, true);
$logManager->write("[API] Rest API request body \n" . $json, LogRecordType::INFO); $logManager->write("[API] Rest API request body -> decodet to json \n" . json_encode($obj, JSON_PRETTY_PRINT), LogRecordType::INFO);
//$logManager->write("[API] Rest API request body -> decodet to json \n" . var_dump($obj), LogRecordType::INFO);
//zabespecit proti Ddosu //zabespecit proti Ddosu
if (isset($obj['user']) && $obj['user'] != ''){ if (isset($obj['user']) && $obj['user'] != ''){
@ -75,7 +74,6 @@ try {
$fallbackManager = new FallbackManager(RANGES); $fallbackManager = new FallbackManager(RANGES);
$fallbackManager->check(); $fallbackManager->check();
LogKeeper::purge(LOGTIMOUT); LogKeeper::purge(LOGTIMOUT);
die();
} catch (\Exception $e) { } catch (\Exception $e) {
$logManager->write("[Automation] Something happen during automation execution", LogRecordType::ERROR); $logManager->write("[Automation] Something happen during automation execution", LogRecordType::ERROR);
} }

View File

@ -239,7 +239,8 @@ $( '[name="room"]' ).change(function (e) {
}); });
} }
}); });
/*
var windowLoc = $(location).attr('pathname'); var windowLoc = $(location).attr('pathname');
windowLoc = windowLoc.substring(windowLoc.lastIndexOf("/")); windowLoc = windowLoc.substring(windowLoc.lastIndexOf("/"));
console.log(); console.log();
@ -275,7 +276,9 @@ pending = false;
}); });
} }
},4000); },4000);
}*/ }
//Graphs //Graphs

View File

@ -145,6 +145,12 @@ class Ajax extends Template
echo 'no action detected'; echo 'no action detected';
break; break;
} }
} else if (
isset($_POST['action']) &&
$_POST['action'] != ''
) {
//TODO: PRO JS VRACET DATA
ECHO 'test';
} }
} }
} }