Commit 332a8849b75ed4d259c84e846b7f960c5c41914e
1 parent
b9009f69
Exists in
master
and in
7 other branches
atualização do código do mapa_controle.php
Showing
8 changed files
with
16 additions
and
19 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/funcoes_gerais.php
... | ... | @@ -1668,7 +1668,7 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) |
1668 | 1668 | } |
1669 | 1669 | } |
1670 | 1670 | $map_tmp = ms_newMapObj($base); |
1671 | - $map_file = $dir_tmp."/".nomerandomico(20).".map"; | |
1671 | + $map_file = $dir_tmp."/downloadTema2".nomerandomico(20).".map"; | |
1672 | 1672 | $map_tmp->setProjection($projecao["proj4"]); |
1673 | 1673 | $map_tmp->save($map_file); |
1674 | 1674 | $nomeRand = false; |
... | ... | @@ -1811,6 +1811,8 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) |
1811 | 1811 | //se o arquivo não tiver sido copiado |
1812 | 1812 | // |
1813 | 1813 | $nomecopia = $dir_tmp."/".basename($meta); |
1814 | + //para evitar que tente copiar um arquivo mapfile | |
1815 | + $nomecopia = str_replace(".map","",$nomecopia); | |
1814 | 1816 | if(file_exists($meta)){ |
1815 | 1817 | if(!file_exists($nomecopia)){ |
1816 | 1818 | copy($meta,$nomecopia); | ... | ... |
classesphp/mapa_controle.php
... | ... | @@ -2554,15 +2554,9 @@ switch (strtoupper($funcao)) |
2554 | 2554 | break; |
2555 | 2555 | |
2556 | 2556 | } |
2557 | -if (!connection_aborted()){ | |
2558 | - if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
2559 | - restauraCon($map_file,$postgis_mapa); | |
2560 | - //$cp->return_data(); | |
2561 | - cpjson($retorno); | |
2562 | -} | |
2563 | -else{ | |
2564 | - exit(); | |
2565 | -} | |
2557 | +if(isset($map_file) && isset($postgis_mapa) && $map_file != "") | |
2558 | + restauraCon($map_file,$postgis_mapa); | |
2559 | +cpjson($retorno); | |
2566 | 2560 | /* |
2567 | 2561 | Function: projetaExt |
2568 | 2562 | ... | ... |
classesphp/mapa_inicia.php
... | ... | @@ -102,7 +102,7 @@ Retorno: |
102 | 102 | */ |
103 | 103 | function iniciaMapa() |
104 | 104 | { |
105 | - global $statusFerramentas,$saikuUrl,$emailInstituicao,$openid,$interfacePadrao,$mensagemInicia,$kmlurl,$tituloInstituicao,$tempo,$navegadoresLocais,$locaplic,$embedLegenda,$map_file,$mapext,$w,$h,$R_path,$locmapserv,$utilizacgi,$expoeMapfile,$interface; | |
105 | + global $postgis_mapa,$statusFerramentas,$saikuUrl,$emailInstituicao,$openid,$interfacePadrao,$mensagemInicia,$kmlurl,$tituloInstituicao,$tempo,$navegadoresLocais,$locaplic,$embedLegenda,$map_file,$mapext,$w,$h,$R_path,$locmapserv,$utilizacgi,$expoeMapfile,$interface; | |
106 | 106 | // |
107 | 107 | //verifica se algum tema e restrito a determinado usuario |
108 | 108 | //as funcoes de validacao encontram-se em funcoes_gerais.php |
... | ... | @@ -379,6 +379,7 @@ function iniciaMapa() |
379 | 379 | $res["editavel"] = $m->mapa->getmetadata("EDITAVEL"); |
380 | 380 | $m->mapa->setmetadata("CUSTOMIZACOESINIT",""); |
381 | 381 | $m->salva(); |
382 | + restauraCon($map_file,$postgis_mapa); | |
382 | 383 | copy($map_file,(str_replace(".map","reinc.map",$map_file))); |
383 | 384 | copy($map_file,(str_replace(".map","seguranca.map",$map_file))); |
384 | 385 | ob_clean(); | ... | ... |
ferramentas/carregamapa/upload.php
... | ... | @@ -4,8 +4,9 @@ require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); |
4 | 4 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
5 | 5 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
6 | 6 | session_name("i3GeoPHP"); |
7 | -if (isset($g_sid)) | |
8 | -{session_id($g_sid);} | |
7 | +if (isset($g_sid)){ | |
8 | + session_id($g_sid); | |
9 | +} | |
9 | 10 | session_start(); |
10 | 11 | $map_file = $_SESSION["map_file"]; |
11 | 12 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
... | ... | @@ -74,6 +75,7 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) |
74 | 75 | $layertemp->setmetadata("editorsql","nao"); |
75 | 76 | $layertemp->setmetadata("EDITAVEL","nao"); |
76 | 77 | $layertemp->setmetadata("PLUGINI3GEO",""); |
78 | + $layertemp->setmetadata("arquivodownload",""); | |
77 | 79 | if ($testa == 1) |
78 | 80 | { |
79 | 81 | echo "<p class='paragrafo' >Problemas em ".($layer->name).". Removido.</p><br>"; | ... | ... |
ferramentas/imprimir/geotif.php
... | ... | @@ -60,7 +60,7 @@ require(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
60 | 60 | error_reporting(0); |
61 | 61 | $nomes = nomeRandomico(); |
62 | 62 | $map = ms_newMapObj($map_file); |
63 | -$temp = str_replace(".map","xxx.map",$map_file); | |
63 | +$temp = str_replace(".map","",$map_file)."xxx.map"; | |
64 | 64 | $map->save($temp); |
65 | 65 | substituiCon($temp,$postgis_mapa); |
66 | 66 | $of = $map->outputformat; | ... | ... |
ferramentas/imprimir/swf.php
... | ... | @@ -5,10 +5,8 @@ session_name("i3GeoPHP"); |
5 | 5 | if (isset($g_sid)) |
6 | 6 | {session_id($g_sid);} |
7 | 7 | session_start(); |
8 | -foreach(array_keys($_SESSION) as $k) | |
9 | -{ | |
10 | - eval("\$".$k."='".$_SESSION[$k]."';"); | |
11 | -} | |
8 | + | |
9 | +$map_file = $_SESSION["map_file"]; | |
12 | 10 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
13 | 11 | // |
14 | 12 | //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido | ... | ... |
temas/_lbairros.map
... | ... | @@ -2,7 +2,7 @@ MAP |
2 | 2 | FONTSET "/var/www/i3geo/symbols/fontes.txt" |
3 | 3 | SYMBOLSET "/var/www/i3geo/symbols/simbolosv6.sym" |
4 | 4 | LAYER |
5 | - CONNECTION "user=postgres password=postgres dbname=i3geosaude host=localhost port=5432" | |
5 | + CONNECTION "i3geosaude" | |
6 | 6 | CONNECTIONTYPE POSTGIS |
7 | 7 | DATA "the_geom from (select gid, st_setsrid(the_geom,4326) as the_geom,co_bairro,no_bairro,no_distr,no_municip from i3geo_metaestat.bairros /*FW*//*FW*/) as foo using unique co_bairro using srid=4326" |
8 | 8 | METADATA | ... | ... |