From e4bad9787fed51dfe0cee7b60504f03c79a0ebbb Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sun, 14 Aug 2016 23:58:17 +0200 Subject: [PATCH] Added vars to enable/disable endpoint.php and newly added (now blank) location.php to config(.dist).php --- config.dist.php | 2 ++ endpoint.php | 4 ++++ location.php | 0 3 files changed, 6 insertions(+) create mode 100644 location.php diff --git a/config.dist.php b/config.dist.php index be67eeb..a3ebe93 100644 --- a/config.dist.php +++ b/config.dist.php @@ -5,4 +5,6 @@ $username = "username"; $password = "password"; $dbname = "database"; +$endpoint = True; $access = False; +$location = False; diff --git a/endpoint.php b/endpoint.php index b91222a..1df3f5a 100644 --- a/endpoint.php +++ b/endpoint.php @@ -2,6 +2,10 @@ require_once("config.php"); +if (!$endpoint) { + die("Endpoint not enabled in config. You should do something about that.") +} + if (isset($_GET["lat"]) && preg_match("/^-?\d+\.\d+$/", $_GET["lat"]) && isset($_GET["lon"]) && preg_match("/^-?\d+\.\d+$/", $_GET["lon"]) && isset($_GET["device"]) ) { $conn = new mysqli($servername, $username, $password, $dbname); diff --git a/location.php b/location.php new file mode 100644 index 0000000..e69de29