Updater Ip address Filtration
This commit is contained in:
parent
44c4c84292
commit
6184f3815f
13
update.php
13
update.php
|
@ -26,6 +26,19 @@ $logManager = new LogManager();
|
||||||
|
|
||||||
header('Content-type: text/plain; charset=utf8', true);
|
header('Content-type: text/plain; charset=utf8', true);
|
||||||
|
|
||||||
|
//Filtrování IP adress
|
||||||
|
if (DEBUGMOD != 1) {
|
||||||
|
if (!in_array($_SERVER['REMOTE_ADDR'], HOMEIP)) {
|
||||||
|
echo json_encode(array(
|
||||||
|
'state' => 'unsuccess',
|
||||||
|
'errorMSG' => "Using API from your IP insnt alowed!",
|
||||||
|
));
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"]." 401 Unauthorized");
|
||||||
|
$logManager->write("[Updater] acces denied from " . $_SERVER['REMOTE_ADDR'], LogRecordType::WARNING);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function sendFile($path)
|
function sendFile($path)
|
||||||
{
|
{
|
||||||
header($_SERVER["SERVER_PROTOCOL"] . ' 200 OK', true, 200);
|
header($_SERVER["SERVER_PROTOCOL"] . ' 200 OK', true, 200);
|
||||||
|
|
Loading…
Reference in New Issue