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