Commit 43dc46f5cbdbbfe19fdfda2e25a259e73017744e
1 parent
682a1afd
Exists in
master
atualização do código do mapa_controle.php
Showing
3 changed files
with
8 additions
and
11 deletions
Show diff stats
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(); | ... | ... |