add backitude support
This commit is contained in:
parent
9e42c79bbc
commit
5a6901161d
14
requests.php
14
requests.php
@ -27,8 +27,12 @@ $requireddb = (isset($_REQUEST['db']) ? $_REQUEST['db'] : 0);
|
|||||||
$tripname = (isset($_REQUEST['tn']) ? $_REQUEST['tn'] : "");
|
$tripname = (isset($_REQUEST['tn']) ? $_REQUEST['tn'] : "");
|
||||||
$action = (isset($_REQUEST['a']) ? $_REQUEST['a'] : "");
|
$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?
|
// FIXME what is it for?
|
||||||
if ($requireddb<8) {
|
elseif ($requireddb<8) {
|
||||||
//Result:5 Incompatible database.
|
//Result:5 Incompatible database.
|
||||||
quit(5);
|
quit(5);
|
||||||
}
|
}
|
||||||
@ -161,7 +165,13 @@ switch($action) {
|
|||||||
case "upload":
|
case "upload":
|
||||||
$lat = isset($_REQUEST["lat"]) ? $_REQUEST["lat"] : NULL;
|
$lat = isset($_REQUEST["lat"]) ? $_REQUEST["lat"] : NULL;
|
||||||
$long = isset($_REQUEST["long"]) ? $_REQUEST["long"] : NULL;
|
$long = isset($_REQUEST["long"]) ? $_REQUEST["long"] : NULL;
|
||||||
$dateoccurred = isset($_REQUEST["do"]) ? $_REQUEST["do"] : 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;
|
$altitude = isset($_REQUEST["alt"]) ? $_REQUEST["alt"] : NULL;
|
||||||
$angle = isset($_REQUEST["ang"]) ? $_REQUEST["ang"] : NULL;
|
$angle = isset($_REQUEST["ang"]) ? $_REQUEST["ang"] : NULL;
|
||||||
$speed = isset($_REQUEST["sp"]) ? $_REQUEST["sp"] : NULL;
|
$speed = isset($_REQUEST["sp"]) ? $_REQUEST["sp"] : NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user