changeset 246:a0a788e1b82e gmap2

Prevent non-cli execution of the makegmaps script.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 17 Mar 2014 03:11:25 +0200
parents 800c3dba43f3
children 51921cbc3c4f 1c32c513d9ba
files tools/makegmaps.php
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/makegmaps.php	Mon Mar 17 03:07:09 2014 +0200
+++ b/tools/makegmaps.php	Mon Mar 17 03:11:25 2014 +0200
@@ -1,5 +1,9 @@
 #!/usr/bin/php
 <?php
+// Prevent non-cli execution
+if (php_sapi_name() != "cli" || !empty($_SERVER["REMOTE_ADDR"]))
+  die("Dongs.\n");
+
 
 $gmapsConfig = "config.php";