diff --git a/aplicmap/geral1.map b/aplicmap/geral1.map index 8625a3e..9da54f6 100755 --- a/aplicmap/geral1.map +++ b/aplicmap/geral1.map @@ -33,7 +33,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" DEBUG OFF # #utilize o agg apenas com mapserver 5x @@ -338,4 +338,4 @@ MAP END END END -END \ No newline at end of file +END diff --git a/aplicmap/geral1debian.map b/aplicmap/geral1debian.map index 90e7de0..7c7a201 100755 --- a/aplicmap/geral1debian.map +++ b/aplicmap/geral1debian.map @@ -33,7 +33,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" DEBUG OFF #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt" # diff --git a/aplicmap/geral1debianv5.map b/aplicmap/geral1debianv5.map index 560ef3d..4eb3f22 100755 --- a/aplicmap/geral1debianv5.map +++ b/aplicmap/geral1debianv5.map @@ -33,7 +33,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" DEBUG OFF #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt" # diff --git a/aplicmap/geral1debianv6.map b/aplicmap/geral1debianv6.map index aa7a0a7..4e57d11 100755 --- a/aplicmap/geral1debianv6.map +++ b/aplicmap/geral1debianv6.map @@ -34,7 +34,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" DEBUG OFF #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt" # diff --git a/aplicmap/geral1debianv7.map b/aplicmap/geral1debianv7.map index 9418e0d..3b3ea2c 100755 --- a/aplicmap/geral1debianv7.map +++ b/aplicmap/geral1debianv7.map @@ -34,7 +34,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" DEBUG OFF #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt" # diff --git a/aplicmap/geral1fedorav5.map b/aplicmap/geral1fedorav5.map index 3f79118..d363b84 100755 --- a/aplicmap/geral1fedorav5.map +++ b/aplicmap/geral1fedorav5.map @@ -33,7 +33,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" DEBUG OFF #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt" # diff --git a/aplicmap/geral1fedorav6.map b/aplicmap/geral1fedorav6.map index f9f345a..fd841de 100755 --- a/aplicmap/geral1fedorav6.map +++ b/aplicmap/geral1fedorav6.map @@ -34,7 +34,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" DEBUG OFF #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt" # diff --git a/aplicmap/geral1fedorav7.map b/aplicmap/geral1fedorav7.map index 1fc5f25..ca22719 100755 --- a/aplicmap/geral1fedorav7.map +++ b/aplicmap/geral1fedorav7.map @@ -34,7 +34,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" DEBUG OFF #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt" # diff --git a/aplicmap/geral1v5.map b/aplicmap/geral1v5.map index 772cf9c..b1abf1d 100755 --- a/aplicmap/geral1v5.map +++ b/aplicmap/geral1v5.map @@ -33,7 +33,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" DEBUG OFF # #utilize o agg apenas com mapserver 5x @@ -338,4 +338,4 @@ MAP END END END -END \ No newline at end of file +END diff --git a/aplicmap/geral1v6.map b/aplicmap/geral1v6.map index 058bc7c..3c0e5d9 100755 --- a/aplicmap/geral1v6.map +++ b/aplicmap/geral1v6.map @@ -34,7 +34,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" DEBUG OFF # #utilize o agg apenas com mapserver 5x @@ -305,4 +305,4 @@ MAP END END END -END \ No newline at end of file +END diff --git a/aplicmap/geral1windows.map b/aplicmap/geral1windows.map index 3900b28..13d6357 100755 --- a/aplicmap/geral1windows.map +++ b/aplicmap/geral1windows.map @@ -32,7 +32,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" OUTPUTFORMAT NAME 'AGG_Q' @@ -374,4 +374,4 @@ MAP END END -END \ No newline at end of file +END diff --git a/aplicmap/geral1windowsv5.map b/aplicmap/geral1windowsv5.map index 2f192c1..f8c9c95 100755 --- a/aplicmap/geral1windowsv5.map +++ b/aplicmap/geral1windowsv5.map @@ -32,7 +32,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" OUTPUTFORMAT NAME 'AGG_Q' @@ -336,4 +336,4 @@ MAP END END -END \ No newline at end of file +END diff --git a/aplicmap/geral1windowsv6.map b/aplicmap/geral1windowsv6.map index 4462810..12aa7d7 100755 --- a/aplicmap/geral1windowsv6.map +++ b/aplicmap/geral1windowsv6.map @@ -33,7 +33,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" OUTPUTFORMAT NAME 'AGG_Q' @@ -305,4 +305,4 @@ MAP END END -END \ No newline at end of file +END diff --git a/aplicmap/geral1windowsv7.map b/aplicmap/geral1windowsv7.map index 65bb525..67071be 100755 --- a/aplicmap/geral1windowsv7.map +++ b/aplicmap/geral1windowsv7.map @@ -33,7 +33,7 @@ MAP SIZE 480 500 STATUS ON UNITS DD - NAME "GERAL" + NAME "i3geomap" OUTPUTFORMAT NAME 'AGG_Q' @@ -305,4 +305,4 @@ MAP END END -END \ No newline at end of file +END diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php index d1207c6..1a3bbc4 100755 --- a/classesphp/funcoes_gerais.php +++ b/classesphp/funcoes_gerais.php @@ -1475,6 +1475,7 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE,$prj="",$proj include_once dirname(__FILE__)."/../pacotes/phpxbase/api_conversion.php"; } $map = @ms_newMapObj($map_file); + $nameMapfile = $map->name; substituiConObj($map,$postgis_mapa); $layer = $map->getlayerbyname($tema); @@ -1509,7 +1510,7 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE,$prj="",$proj $novonomelayer = $tema; } $novonomelayer = str_replace(".","-",$novonomelayer); - $nomeshp = $dir_tmp."/".$novonomelayer; + $nomeshp = $dir_tmp."/".$nameMapfile."_".$novonomelayer; if(file_exists($nomeshp.".shp")){ return $nomeshp; @@ -1731,6 +1732,7 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) } } $map_tmp = ms_newMapObj($base); + $map_file = $dir_tmp."/downloadTema2".nomerandomico(20).".map"; $map_tmp->setProjection($projecao["proj4"]); $map_tmp->save($map_file); @@ -1819,6 +1821,7 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) //$map_file agora contem os LAYERS necessários $map = ms_newMapObj($map_file); substituiConObj($map,$postgis_mapa); + $nameMapfile = $map->name; // //verifica se existe mais de um tema (grupo) montando o array com os temas //os grupos podem ter o nome do layer em GROUP ao invés de NAME @@ -1851,7 +1854,8 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) foreach ($temas as $tema){ $l = $map->getlayerbyname($tema); $novonomelayer = $tema; - $nomeshp = $dir_tmp."/".$novonomelayer; + //usa o NAME do mapfile para nao gerar arquivos com o mesmo nome em instalacoes multiplas do i3geo + $nomeshp = $dir_tmp."/".$nameMapfile."_".$novonomelayer; if(file_exists($nomeshp.".dbf")){ // //verifica se o arquivo está vazio ou não @@ -1874,7 +1878,9 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) // //se o arquivo não tiver sido copiado // - $nomecopia = $dir_tmp."/".basename($meta); + //evita que se tente copiar qualquer arquivo + $meta = str_replace(".zip","",$meta).".zip"; + $nomecopia = $dir_tmp."/".$nameMapfile."_".basename($meta); //para evitar que tente copiar um arquivo mapfile $nomecopia = str_replace(".map","",$nomecopia); $nomecopia = str_replace(".zip","zip",$nomecopia).".zip"; @@ -1894,14 +1900,16 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) if (file_exists($dados)){ $dir = dirname($dados); $arq = explode(".",basename($dados)); - $nomecopia = $dir_tmp."/".$arq[0]; + $nomecopia = $dir_tmp."/".$nameMapfile."_".$arq[0]; $exts = array("jpg","jpw","tif","tifw","tfw","png","pngw","jpgw","wld","img"); foreach($exts as $ext){ $copia = $nomecopia.".".$ext; - if(!file_exists($copia) && file_exists($dir."/".$arq[0].".".$ext)) - {copy($dir."/".$arq[0].".".$ext,$copia);} - if(file_exists($copia)) - $resultado[] = basename($dir_tmp)."/".basename($copia); + if(!file_exists($copia) && file_exists($dir."/".$arq[0].".".$ext)){ + copy($dir."/".$arq[0].".".$ext,$copia); + } + if(file_exists($copia)){ + $resultado[] = basename($dir_tmp)."/".basename($copia); + } } } else{ diff --git a/ferramentas/carregamapa/upload.php b/ferramentas/carregamapa/upload.php index 16eddd6..8fcdcb0 100755 --- a/ferramentas/carregamapa/upload.php +++ b/ferramentas/carregamapa/upload.php @@ -48,6 +48,10 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name']) && strlen(basename($_FILES if($checkphp == true){ exit; } + $checkphp = fileContemString($_FILES['i3GEOcarregamapafilemap']['tmp_name'],".php"); + if($checkphp == true){ + exit; + } $nome = basename($Arquivo); $arqtemp = $dirmap."/".$Arquivo; -- libgit2 0.21.2