Added vars to enable/disable endpoint.php and newly added (now blank) location.php to config(.dist).php
This commit is contained in:
parent
f93a6eba03
commit
e4bad9787f
|
@ -5,4 +5,6 @@ $username = "username";
|
||||||
$password = "password";
|
$password = "password";
|
||||||
$dbname = "database";
|
$dbname = "database";
|
||||||
|
|
||||||
|
$endpoint = True;
|
||||||
$access = False;
|
$access = False;
|
||||||
|
$location = False;
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
require_once("config.php");
|
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"]) ) {
|
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);
|
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||||
|
|
0
location.php
Normal file
0
location.php
Normal file
Loading…
Reference in a new issue