diff --git a/static/tracking/conscrit.html b/static/tracking/conscrit.html index d949e29..f7d9128 100644 --- a/static/tracking/conscrit.html +++ b/static/tracking/conscrit.html @@ -61,7 +61,7 @@ ////////////////////////////////////////////////////////////////////////////// // GEOLOCALISATION - setup_geoLoc(); + if(%GPSLOG) setup_geoLoc(); diff --git a/static/tracking/vieux.html b/static/tracking/vieux.html index 4360a1c..9de3a53 100644 --- a/static/tracking/vieux.html +++ b/static/tracking/vieux.html @@ -89,7 +89,7 @@ ////////////////////////////////////////////////////////////////////////////// // GEOLOCALISATION - setup_geoLoc(); + if(%GPSLOG) setup_geoLoc(); diff --git a/traque.js b/traque.js index ff9962b..4746a1f 100644 --- a/traque.js +++ b/traque.js @@ -53,6 +53,11 @@ var server = http.createServer(option, function(req, res){ if(q.pathname.startsWith("/tracking/")){ id = q.pathname.substring("/tracking/".length); + gpslog = true; + if(id.startsWith("nolog/")){ + gpslog = false; + id = id.substring("nolog/".length); + } var end_path = ["conscrit.html", "vieux.html", "invalid.html"][config.validator(id)]; filename = "static/tracking/" + end_path; return fs.readFile(filename, 'utf8', function(err, data){ @@ -60,7 +65,7 @@ var server = http.createServer(option, function(req, res){ throw new Error("where " + end_path + " is !?"); res.writeHead(200, {'Content-Type': 'text/html'}); - res.write(data.replaceAll("%ID", id)); + res.write(data.replaceAll("%ID", id).replaceAll("%GPSLOG", gpslog)); return res.end(); }); }