diff --git a/server/ping.php b/server/ping.php index 56bc660..42982e4 100644 --- a/server/ping.php +++ b/server/ping.php @@ -1,12 +1,17 @@ +require_once('config.inc.php'); +$apikeys = $config['ping']; + +header('Content-type: text/plain'); +if ($_SERVER['REQUEST_METHOD'] == 'POST' && + isset($_GET['apikey']) && in_array($_GET['apikey'], $apikeys, true)) +{ + file_put_contents ( 'pinged.txt' , 'true' ); + echo $str; +} else { + $str=file_get_contents('pinged.txt'); + echo "API Key Missing (must be POST method)!\n"; + echo $str; +} +?>