Commit f88e50669c3a432d8786c6069423960bea83b8da
1 parent
6304f028
Exists in
master
and in
7 other branches
Mudanças para funcionamento com register_globals = On no PHP.INI
Showing
3 changed files
with
17 additions
and
16 deletions
Show diff stats
classesphp/mapa_googleearth.php
... | ... | @@ -60,13 +60,13 @@ else |
60 | 60 | {ilegal();} |
61 | 61 | */ |
62 | 62 | // |
63 | -$map_file = $_SESSION["map_file"]; | |
63 | +$map_fileX = $_SESSION["map_file"]; | |
64 | 64 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
65 | 65 | |
66 | 66 | if($_GET["REQUEST"] == "GetKml") |
67 | 67 | {retornaKml();} |
68 | 68 | else |
69 | -{retornaWms($map_file,$postgis_mapa);} | |
69 | +{retornaWms($map_fileX,$postgis_mapa);} | |
70 | 70 | return; |
71 | 71 | function retornaKml(){ |
72 | 72 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); |
... | ... | @@ -99,7 +99,7 @@ function retornaKml(){ |
99 | 99 | echo header("Content-type: application/xml"); |
100 | 100 | echo $kml; |
101 | 101 | } |
102 | -function retornaWms($map_file,$postgis_mapa){ | |
102 | +function retornaWms($map_fileX,$postgis_mapa){ | |
103 | 103 | error_reporting(0); |
104 | 104 | if(isset($_GET["bbox"])) |
105 | 105 | {$_GET["BBOX"] = $_GET["bbox"];} |
... | ... | @@ -114,7 +114,7 @@ function retornaWms($map_file,$postgis_mapa){ |
114 | 114 | $_GET["HEIGHT"] = ($_GET["WIDTH"] / $dx) * $dy; |
115 | 115 | //$_GET["map_size"] = $_GET["WIDTH"]." ".$_GET["HEIGHT"]; |
116 | 116 | } |
117 | - $mapa = ms_newMapObj($map_file); | |
117 | + $mapa = ms_newMapObj($map_fileX); | |
118 | 118 | $mapa->setProjection("init=epsg:4326"); |
119 | 119 | /* |
120 | 120 | $qyfile = str_replace(".map",".qy",$_GET["map"]); |
... | ... | @@ -125,7 +125,7 @@ function retornaWms($map_file,$postgis_mapa){ |
125 | 125 | // |
126 | 126 | //resolve o problema da seleção na versão nova do mapserver |
127 | 127 | // |
128 | - $qyfile = dirname($map_file)."/".$_GET["layer"].".php"; | |
128 | + $qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; | |
129 | 129 | $qy = file_exists($qyfile); |
130 | 130 | if($qy) |
131 | 131 | { | ... | ... |
classesphp/mapa_googlemaps.php
... | ... | @@ -82,7 +82,7 @@ if(@$_SESSION["fingerprint"]) |
82 | 82 | else |
83 | 83 | {ilegal();} |
84 | 84 | // |
85 | -$map_file = $_SESSION["map_file"]; | |
85 | +$map_fileX = $_SESSION["map_file"]; | |
86 | 86 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
87 | 87 | // |
88 | 88 | //converte a requisição do tile em coordenadas geo |
... | ... | @@ -116,7 +116,7 @@ if(!isset($_GET["HEIGHT"])) |
116 | 116 | {$_GET["HEIGHT"] = "256";} |
117 | 117 | $_GET["map_size"] = $_GET["WIDTH"]." ".$_GET["HEIGHT"]; |
118 | 118 | |
119 | -$mapa = ms_newMapObj($map_file); | |
119 | +$mapa = ms_newMapObj($map_fileX); | |
120 | 120 | /* |
121 | 121 | $qyfile = str_replace(".map",".qy",$_GET["map"]); |
122 | 122 | $qy = file_exists($qyfile); |
... | ... | @@ -126,7 +126,7 @@ if($qy) |
126 | 126 | // |
127 | 127 | //resolve o problema da seleção na versão nova do mapserver |
128 | 128 | // |
129 | -$qyfile = dirname($map_file)."/".$_GET["layer"].".php"; | |
129 | +$qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; | |
130 | 130 | $qy = file_exists($qyfile); |
131 | 131 | if($qy) |
132 | 132 | { |
... | ... | @@ -205,7 +205,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") |
205 | 205 | if($qy) |
206 | 206 | {$cache = false;} |
207 | 207 | if($cache == true) |
208 | -{carregaCacheImagem($_GET["BBOX"],$nomecache,$map_file,$_GET["WIDTH"],$_GET["HEIGHT"]);} | |
208 | +{carregaCacheImagem($_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);} | |
209 | 209 | |
210 | 210 | $map_size = explode(" ",$_GET["map_size"]); |
211 | 211 | $mapa->setsize($map_size[0],$map_size[1]); |
... | ... | @@ -260,7 +260,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") |
260 | 260 | } |
261 | 261 | else{ |
262 | 262 | if($cache == true) |
263 | - {salvaCacheImagem($_GET["BBOX"],$nomecache,$map_file,$_GET["WIDTH"],$_GET["HEIGHT"]);} | |
263 | + {salvaCacheImagem($_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);} | |
264 | 264 | ob_clean(); |
265 | 265 | $nomer = ($img->imagepath)."imgtemp".nomeRandomico(); |
266 | 266 | $img->saveImage($nomer); | ... | ... |
classesphp/mapa_openlayers.php
... | ... | @@ -81,20 +81,21 @@ if(@$_SESSION["fingerprint"]) |
81 | 81 | else |
82 | 82 | {ilegal();} |
83 | 83 | // |
84 | -$map_file = $_SESSION["map_file"]; | |
84 | +//map_fileX é necessário caso register_globals = On no PHP.INI | |
85 | +$map_fileX = $_SESSION["map_file"]; | |
85 | 86 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
86 | 87 | if(isset($_GET["tipolayer"]) && $_GET["tipolayer"] == "fundo") |
87 | -{$map_file = str_replace(".map","fundo.map",$map_file);} | |
88 | +{$map_fileX = str_replace(".map","fundo.map",$map_fileX);} | |
88 | 89 | if(isset($_GET["BBOX"])) |
89 | 90 | { |
90 | 91 | $_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]); |
91 | 92 | $_GET["map_size"] = $_GET["WIDTH"]." ".$_GET["HEIGHT"]; |
92 | 93 | } |
93 | -$mapa = ms_newMapObj($map_file); //map_file vem de section | |
94 | +$mapa = ms_newMapObj($map_fileX); //map_file vem de section | |
94 | 95 | // |
95 | 96 | //resolve o problema da seleção na versão nova do mapserver |
96 | 97 | // |
97 | -$qyfile = dirname($map_file)."/".$_GET["layer"].".php"; | |
98 | +$qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; | |
98 | 99 | $qy = file_exists($qyfile); |
99 | 100 | if($qy) |
100 | 101 | { |
... | ... | @@ -170,7 +171,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") |
170 | 171 | {$cache = false;} |
171 | 172 | |
172 | 173 | if($cache == true) |
173 | -{carregaCacheImagem($_GET["BBOX"],$nomecache,$map_file,$_GET["WIDTH"],$_GET["HEIGHT"]);} | |
174 | +{carregaCacheImagem($_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);} | |
174 | 175 | |
175 | 176 | $map_size = explode(" ",$_GET["map_size"]); |
176 | 177 | $mapa->setsize($map_size[0],$map_size[1]); |
... | ... | @@ -247,7 +248,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") |
247 | 248 | } |
248 | 249 | else{ |
249 | 250 | if($cache == true) |
250 | - {salvaCacheImagem($_GET["BBOX"],$nomecache,$map_file,$_GET["WIDTH"],$_GET["HEIGHT"]);} | |
251 | + {salvaCacheImagem($_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);} | |
251 | 252 | ob_clean(); |
252 | 253 | $nomer = ($img->imagepath)."imgtemp".nomeRandomico(); |
253 | 254 | $img->saveImage($nomer); | ... | ... |