Commit f88e50669c3a432d8786c6069423960bea83b8da

Authored by Edmar Moretti
1 parent 6304f028

Mudanças para funcionamento com register_globals = On no PHP.INI

classesphp/mapa_googleearth.php
@@ -60,13 +60,13 @@ else @@ -60,13 +60,13 @@ else
60 {ilegal();} 60 {ilegal();}
61 */ 61 */
62 // 62 //
63 -$map_file = $_SESSION["map_file"]; 63 +$map_fileX = $_SESSION["map_file"];
64 $postgis_mapa = $_SESSION["postgis_mapa"]; 64 $postgis_mapa = $_SESSION["postgis_mapa"];
65 65
66 if($_GET["REQUEST"] == "GetKml") 66 if($_GET["REQUEST"] == "GetKml")
67 {retornaKml();} 67 {retornaKml();}
68 else 68 else
69 -{retornaWms($map_file,$postgis_mapa);} 69 +{retornaWms($map_fileX,$postgis_mapa);}
70 return; 70 return;
71 function retornaKml(){ 71 function retornaKml(){
72 $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); 72 $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']);
@@ -99,7 +99,7 @@ function retornaKml(){ @@ -99,7 +99,7 @@ function retornaKml(){
99 echo header("Content-type: application/xml"); 99 echo header("Content-type: application/xml");
100 echo $kml; 100 echo $kml;
101 } 101 }
102 -function retornaWms($map_file,$postgis_mapa){ 102 +function retornaWms($map_fileX,$postgis_mapa){
103 error_reporting(0); 103 error_reporting(0);
104 if(isset($_GET["bbox"])) 104 if(isset($_GET["bbox"]))
105 {$_GET["BBOX"] = $_GET["bbox"];} 105 {$_GET["BBOX"] = $_GET["bbox"];}
@@ -114,7 +114,7 @@ function retornaWms($map_file,$postgis_mapa){ @@ -114,7 +114,7 @@ function retornaWms($map_file,$postgis_mapa){
114 $_GET["HEIGHT"] = ($_GET["WIDTH"] / $dx) * $dy; 114 $_GET["HEIGHT"] = ($_GET["WIDTH"] / $dx) * $dy;
115 //$_GET["map_size"] = $_GET["WIDTH"]." ".$_GET["HEIGHT"]; 115 //$_GET["map_size"] = $_GET["WIDTH"]." ".$_GET["HEIGHT"];
116 } 116 }
117 - $mapa = ms_newMapObj($map_file); 117 + $mapa = ms_newMapObj($map_fileX);
118 $mapa->setProjection("init=epsg:4326"); 118 $mapa->setProjection("init=epsg:4326");
119 /* 119 /*
120 $qyfile = str_replace(".map",".qy",$_GET["map"]); 120 $qyfile = str_replace(".map",".qy",$_GET["map"]);
@@ -125,7 +125,7 @@ function retornaWms($map_file,$postgis_mapa){ @@ -125,7 +125,7 @@ function retornaWms($map_file,$postgis_mapa){
125 // 125 //
126 //resolve o problema da seleção na versão nova do mapserver 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 $qy = file_exists($qyfile); 129 $qy = file_exists($qyfile);
130 if($qy) 130 if($qy)
131 { 131 {
classesphp/mapa_googlemaps.php
@@ -82,7 +82,7 @@ if(@$_SESSION["fingerprint"]) @@ -82,7 +82,7 @@ if(@$_SESSION["fingerprint"])
82 else 82 else
83 {ilegal();} 83 {ilegal();}
84 // 84 //
85 -$map_file = $_SESSION["map_file"]; 85 +$map_fileX = $_SESSION["map_file"];
86 $postgis_mapa = $_SESSION["postgis_mapa"]; 86 $postgis_mapa = $_SESSION["postgis_mapa"];
87 // 87 //
88 //converte a requisição do tile em coordenadas geo 88 //converte a requisição do tile em coordenadas geo
@@ -116,7 +116,7 @@ if(!isset($_GET["HEIGHT"])) @@ -116,7 +116,7 @@ if(!isset($_GET["HEIGHT"]))
116 {$_GET["HEIGHT"] = "256";} 116 {$_GET["HEIGHT"] = "256";}
117 $_GET["map_size"] = $_GET["WIDTH"]." ".$_GET["HEIGHT"]; 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 $qyfile = str_replace(".map",".qy",$_GET["map"]); 121 $qyfile = str_replace(".map",".qy",$_GET["map"]);
122 $qy = file_exists($qyfile); 122 $qy = file_exists($qyfile);
@@ -126,7 +126,7 @@ if($qy) @@ -126,7 +126,7 @@ if($qy)
126 // 126 //
127 //resolve o problema da seleção na versão nova do mapserver 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 $qy = file_exists($qyfile); 130 $qy = file_exists($qyfile);
131 if($qy) 131 if($qy)
132 { 132 {
@@ -205,7 +205,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") @@ -205,7 +205,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum")
205 if($qy) 205 if($qy)
206 {$cache = false;} 206 {$cache = false;}
207 if($cache == true) 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 $map_size = explode(" ",$_GET["map_size"]); 210 $map_size = explode(" ",$_GET["map_size"]);
211 $mapa->setsize($map_size[0],$map_size[1]); 211 $mapa->setsize($map_size[0],$map_size[1]);
@@ -260,7 +260,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") @@ -260,7 +260,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum")
260 } 260 }
261 else{ 261 else{
262 if($cache == true) 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 ob_clean(); 264 ob_clean();
265 $nomer = ($img->imagepath)."imgtemp".nomeRandomico(); 265 $nomer = ($img->imagepath)."imgtemp".nomeRandomico();
266 $img->saveImage($nomer); 266 $img->saveImage($nomer);
classesphp/mapa_openlayers.php
@@ -81,20 +81,21 @@ if(@$_SESSION["fingerprint"]) @@ -81,20 +81,21 @@ if(@$_SESSION["fingerprint"])
81 else 81 else
82 {ilegal();} 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 $postgis_mapa = $_SESSION["postgis_mapa"]; 86 $postgis_mapa = $_SESSION["postgis_mapa"];
86 if(isset($_GET["tipolayer"]) && $_GET["tipolayer"] == "fundo") 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 if(isset($_GET["BBOX"])) 89 if(isset($_GET["BBOX"]))
89 { 90 {
90 $_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]); 91 $_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]);
91 $_GET["map_size"] = $_GET["WIDTH"]." ".$_GET["HEIGHT"]; 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 //resolve o problema da seleção na versão nova do mapserver 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 $qy = file_exists($qyfile); 99 $qy = file_exists($qyfile);
99 if($qy) 100 if($qy)
100 { 101 {
@@ -170,7 +171,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") @@ -170,7 +171,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum")
170 {$cache = false;} 171 {$cache = false;}
171 172
172 if($cache == true) 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 $map_size = explode(" ",$_GET["map_size"]); 176 $map_size = explode(" ",$_GET["map_size"]);
176 $mapa->setsize($map_size[0],$map_size[1]); 177 $mapa->setsize($map_size[0],$map_size[1]);
@@ -247,7 +248,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") @@ -247,7 +248,7 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum")
247 } 248 }
248 else{ 249 else{
249 if($cache == true) 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 ob_clean(); 252 ob_clean();
252 $nomer = ($img->imagepath)."imgtemp".nomeRandomico(); 253 $nomer = ($img->imagepath)."imgtemp".nomeRandomico();
253 $img->saveImage($nomer); 254 $img->saveImage($nomer);