add backitude support

This commit is contained in:
Mark Campbell-Smith 2014-04-01 14:12:17 +11:00
parent 9e42c79bbc
commit 5a6901161d

View File

@ -27,8 +27,12 @@ $requireddb = (isset($_REQUEST['db']) ? $_REQUEST['db'] : 0);
$tripname = (isset($_REQUEST['tn']) ? $_REQUEST['tn'] : "");
$action = (isset($_REQUEST['a']) ? $_REQUEST['a'] : "");
// If the client uses Backitude then define the tripname as user-date
if ($requireddb == 'backitude') {
$tripname = $user.'-'.date("Ymd");
}
// FIXME what is it for?
if ($requireddb<8) {
elseif ($requireddb<8) {
//Result:5 Incompatible database.
quit(5);
}
@ -161,7 +165,13 @@ switch($action) {
case "upload":
$lat = isset($_REQUEST["lat"]) ? $_REQUEST["lat"] : NULL;
$long = isset($_REQUEST["long"]) ? $_REQUEST["long"] : NULL;
// If the client uses Backitude then convert the date into handled format
if ($requireddb == 'backitude') {
$dateoccurred = isset($_REQUEST["do"]) ? date("Y-m-d H:i:s",intval($_REQUEST["do"])) : NULL;
}
else {
$dateoccurred = isset($_REQUEST["do"]) ? $_REQUEST["do"] : NULL;
}
$altitude = isset($_REQUEST["alt"]) ? $_REQUEST["alt"] : NULL;
$angle = isset($_REQUEST["ang"]) ? $_REQUEST["ang"] : NULL;
$speed = isset($_REQUEST["sp"]) ? $_REQUEST["sp"] : NULL;