-
Notifications
You must be signed in to change notification settings - Fork 0
/
op2gpx-locus.php
54 lines (42 loc) · 1.25 KB
/
op2gpx-locus.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
include 'misc.php';
$redirecturl = "<![CDATA[http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME'])."/op2gpx.php";
$pcount = 0;
$reroute = 0;
foreach($_GET as $idx => $val){
if($pcount++ == 0)
$redirecturl .= "?";
else
$redirecturl .= "&";
if($idx != "act"){ // act is handled by this script later
$redirecturl .= $idx."=";
if($idx == "reroute")
$reroute = 1;
if($idx == "query"){
// get timeout
$timeout = get_query_timeout($val);
$redirecturl .= urlencode($val); // query has to be re-urlencoded
}
else
$redirecturl .= $val; // no special meaning, simply pass the param
}
}
$redirecturl .= "]]>";
$timeout = get_timeout_with_margin($timeout, $reroute);
print("<?xml version=\"1.0\" encoding=\"utf-8\"?>
<locusActions>
<download>
<source timeout=\"$timeout\">
$redirecturl
</source>");
if(isset($_GET['zip']) && $_GET['zip'] == "yes")
print("<dest><![CDATA[/mapItems/op2gpx.zip]]></dest>");
else
print("<dest><![CDATA[/mapItems/op2gpx.gpx]]></dest>");
if(isset($_GET['act']) && $_GET['act'] == "import")
print("<after>importData</after>");
else
print("<after>displayData</after>");
print("</download>
</locusActions>");
?>