Commit e5282faed29b69aca31ac072b58def63c07d1fa2

Authored by Edmar Moretti
1 parent b0c9f3d6
Exists in master

Alteracao de NAME nos mapfiles de inicializacao. Uso de NAME como prefixo nos ar…

…quivos gerados para download
aplicmap/geral1.map
... ... @@ -33,7 +33,7 @@ MAP
33 33 SIZE 480 500
34 34 STATUS ON
35 35 UNITS DD
36   - NAME "GERAL"
  36 + NAME "i3geomap"
37 37 DEBUG OFF
38 38 #
39 39 #utilize o agg apenas com mapserver 5x
... ... @@ -338,4 +338,4 @@ MAP
338 338 END
339 339 END
340 340 END
341   -END
342 341 \ No newline at end of file
  342 +END
... ...
aplicmap/geral1debian.map
... ... @@ -33,7 +33,7 @@ MAP
33 33 SIZE 480 500
34 34 STATUS ON
35 35 UNITS DD
36   - NAME "GERAL"
  36 + NAME "i3geomap"
37 37 DEBUG OFF
38 38 #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt"
39 39 #
... ...
aplicmap/geral1debianv5.map
... ... @@ -33,7 +33,7 @@ MAP
33 33 SIZE 480 500
34 34 STATUS ON
35 35 UNITS DD
36   - NAME "GERAL"
  36 + NAME "i3geomap"
37 37 DEBUG OFF
38 38 #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt"
39 39 #
... ...
aplicmap/geral1debianv6.map
... ... @@ -34,7 +34,7 @@ MAP
34 34 SIZE 480 500
35 35 STATUS ON
36 36 UNITS DD
37   - NAME "GERAL"
  37 + NAME "i3geomap"
38 38 DEBUG OFF
39 39 #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt"
40 40 #
... ...
aplicmap/geral1debianv7.map
... ... @@ -34,7 +34,7 @@ MAP
34 34 SIZE 480 500
35 35 STATUS ON
36 36 UNITS DD
37   - NAME "GERAL"
  37 + NAME "i3geomap"
38 38 DEBUG OFF
39 39 #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt"
40 40 #
... ...
aplicmap/geral1fedorav5.map
... ... @@ -33,7 +33,7 @@ MAP
33 33 SIZE 480 500
34 34 STATUS ON
35 35 UNITS DD
36   - NAME "GERAL"
  36 + NAME "i3geomap"
37 37 DEBUG OFF
38 38 #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt"
39 39 #
... ...
aplicmap/geral1fedorav6.map
... ... @@ -34,7 +34,7 @@ MAP
34 34 SIZE 480 500
35 35 STATUS ON
36 36 UNITS DD
37   - NAME "GERAL"
  37 + NAME "i3geomap"
38 38 DEBUG OFF
39 39 #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt"
40 40 #
... ...
aplicmap/geral1fedorav7.map
... ... @@ -34,7 +34,7 @@ MAP
34 34 SIZE 480 500
35 35 STATUS ON
36 36 UNITS DD
37   - NAME "GERAL"
  37 + NAME "i3geomap"
38 38 DEBUG OFF
39 39 #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt"
40 40 #
... ...
aplicmap/geral1v5.map
... ... @@ -33,7 +33,7 @@ MAP
33 33 SIZE 480 500
34 34 STATUS ON
35 35 UNITS DD
36   - NAME "GERAL"
  36 + NAME "i3geomap"
37 37 DEBUG OFF
38 38 #
39 39 #utilize o agg apenas com mapserver 5x
... ... @@ -338,4 +338,4 @@ MAP
338 338 END
339 339 END
340 340 END
341   -END
342 341 \ No newline at end of file
  342 +END
... ...
aplicmap/geral1v6.map
... ... @@ -34,7 +34,7 @@ MAP
34 34 SIZE 480 500
35 35 STATUS ON
36 36 UNITS DD
37   - NAME "GERAL"
  37 + NAME "i3geomap"
38 38 DEBUG OFF
39 39 #
40 40 #utilize o agg apenas com mapserver 5x
... ... @@ -305,4 +305,4 @@ MAP
305 305 END
306 306 END
307 307 END
308   -END
309 308 \ No newline at end of file
  309 +END
... ...
aplicmap/geral1windows.map
... ... @@ -32,7 +32,7 @@ MAP
32 32 SIZE 480 500
33 33 STATUS ON
34 34 UNITS DD
35   - NAME "GERAL"
  35 + NAME "i3geomap"
36 36  
37 37 OUTPUTFORMAT
38 38 NAME 'AGG_Q'
... ... @@ -374,4 +374,4 @@ MAP
374 374 END
375 375 END
376 376  
377   -END
378 377 \ No newline at end of file
  378 +END
... ...
aplicmap/geral1windowsv5.map
... ... @@ -32,7 +32,7 @@ MAP
32 32 SIZE 480 500
33 33 STATUS ON
34 34 UNITS DD
35   - NAME "GERAL"
  35 + NAME "i3geomap"
36 36  
37 37 OUTPUTFORMAT
38 38 NAME 'AGG_Q'
... ... @@ -336,4 +336,4 @@ MAP
336 336 END
337 337 END
338 338  
339   -END
340 339 \ No newline at end of file
  340 +END
... ...
aplicmap/geral1windowsv6.map
... ... @@ -33,7 +33,7 @@ MAP
33 33 SIZE 480 500
34 34 STATUS ON
35 35 UNITS DD
36   - NAME "GERAL"
  36 + NAME "i3geomap"
37 37  
38 38 OUTPUTFORMAT
39 39 NAME 'AGG_Q'
... ... @@ -305,4 +305,4 @@ MAP
305 305 END
306 306 END
307 307  
308   -END
309 308 \ No newline at end of file
  309 +END
... ...
aplicmap/geral1windowsv7.map
... ... @@ -33,7 +33,7 @@ MAP
33 33 SIZE 480 500
34 34 STATUS ON
35 35 UNITS DD
36   - NAME "GERAL"
  36 + NAME "i3geomap"
37 37  
38 38 OUTPUTFORMAT
39 39 NAME 'AGG_Q'
... ... @@ -305,4 +305,4 @@ MAP
305 305 END
306 306 END
307 307  
308   -END
309 308 \ No newline at end of file
  309 +END
... ...
classesphp/funcoes_gerais.php
... ... @@ -1475,6 +1475,7 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE,$prj="",$proj
1475 1475 include_once dirname(__FILE__)."/../pacotes/phpxbase/api_conversion.php";
1476 1476 }
1477 1477 $map = @ms_newMapObj($map_file);
  1478 + $nameMapfile = $map->name;
1478 1479 substituiConObj($map,$postgis_mapa);
1479 1480  
1480 1481 $layer = $map->getlayerbyname($tema);
... ... @@ -1509,7 +1510,7 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE,$prj="",$proj
1509 1510 $novonomelayer = $tema;
1510 1511 }
1511 1512 $novonomelayer = str_replace(".","-",$novonomelayer);
1512   - $nomeshp = $dir_tmp."/".$novonomelayer;
  1513 + $nomeshp = $dir_tmp."/".$nameMapfile."_".$novonomelayer;
1513 1514  
1514 1515 if(file_exists($nomeshp.".shp")){
1515 1516 return $nomeshp;
... ... @@ -1731,6 +1732,7 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa)
1731 1732 }
1732 1733 }
1733 1734 $map_tmp = ms_newMapObj($base);
  1735 +
1734 1736 $map_file = $dir_tmp."/downloadTema2".nomerandomico(20).".map";
1735 1737 $map_tmp->setProjection($projecao["proj4"]);
1736 1738 $map_tmp->save($map_file);
... ... @@ -1819,6 +1821,7 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa)
1819 1821 //$map_file agora contem os LAYERS necessários
1820 1822 $map = ms_newMapObj($map_file);
1821 1823 substituiConObj($map,$postgis_mapa);
  1824 + $nameMapfile = $map->name;
1822 1825 //
1823 1826 //verifica se existe mais de um tema (grupo) montando o array com os temas
1824 1827 //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)
1851 1854 foreach ($temas as $tema){
1852 1855 $l = $map->getlayerbyname($tema);
1853 1856 $novonomelayer = $tema;
1854   - $nomeshp = $dir_tmp."/".$novonomelayer;
  1857 + //usa o NAME do mapfile para nao gerar arquivos com o mesmo nome em instalacoes multiplas do i3geo
  1858 + $nomeshp = $dir_tmp."/".$nameMapfile."_".$novonomelayer;
1855 1859 if(file_exists($nomeshp.".dbf")){
1856 1860 //
1857 1861 //verifica se o arquivo está vazio ou não
... ... @@ -1874,7 +1878,9 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa)
1874 1878 //
1875 1879 //se o arquivo não tiver sido copiado
1876 1880 //
1877   - $nomecopia = $dir_tmp."/".basename($meta);
  1881 + //evita que se tente copiar qualquer arquivo
  1882 + $meta = str_replace(".zip","",$meta).".zip";
  1883 + $nomecopia = $dir_tmp."/".$nameMapfile."_".basename($meta);
1878 1884 //para evitar que tente copiar um arquivo mapfile
1879 1885 $nomecopia = str_replace(".map","",$nomecopia);
1880 1886 $nomecopia = str_replace(".zip","zip",$nomecopia).".zip";
... ... @@ -1894,14 +1900,16 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa)
1894 1900 if (file_exists($dados)){
1895 1901 $dir = dirname($dados);
1896 1902 $arq = explode(".",basename($dados));
1897   - $nomecopia = $dir_tmp."/".$arq[0];
  1903 + $nomecopia = $dir_tmp."/".$nameMapfile."_".$arq[0];
1898 1904 $exts = array("jpg","jpw","tif","tifw","tfw","png","pngw","jpgw","wld","img");
1899 1905 foreach($exts as $ext){
1900 1906 $copia = $nomecopia.".".$ext;
1901   - if(!file_exists($copia) && file_exists($dir."/".$arq[0].".".$ext))
1902   - {copy($dir."/".$arq[0].".".$ext,$copia);}
1903   - if(file_exists($copia))
1904   - $resultado[] = basename($dir_tmp)."/".basename($copia);
  1907 + if(!file_exists($copia) && file_exists($dir."/".$arq[0].".".$ext)){
  1908 + copy($dir."/".$arq[0].".".$ext,$copia);
  1909 + }
  1910 + if(file_exists($copia)){
  1911 + $resultado[] = basename($dir_tmp)."/".basename($copia);
  1912 + }
1905 1913 }
1906 1914 }
1907 1915 else{
... ...
ferramentas/carregamapa/upload.php
... ... @@ -48,6 +48,10 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name']) && strlen(basename($_FILES
48 48 if($checkphp == true){
49 49 exit;
50 50 }
  51 + $checkphp = fileContemString($_FILES['i3GEOcarregamapafilemap']['tmp_name'],".php");
  52 + if($checkphp == true){
  53 + exit;
  54 + }
51 55  
52 56 $nome = basename($Arquivo);
53 57 $arqtemp = $dirmap."/".$Arquivo;
... ...