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,7 +1668,7 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) | ||
1668 | } | 1668 | } |
1669 | } | 1669 | } |
1670 | $map_tmp = ms_newMapObj($base); | 1670 | $map_tmp = ms_newMapObj($base); |
1671 | - $map_file = $dir_tmp."/".nomerandomico(20).".map"; | 1671 | + $map_file = $dir_tmp."/downloadTema2".nomerandomico(20).".map"; |
1672 | $map_tmp->setProjection($projecao["proj4"]); | 1672 | $map_tmp->setProjection($projecao["proj4"]); |
1673 | $map_tmp->save($map_file); | 1673 | $map_tmp->save($map_file); |
1674 | $nomeRand = false; | 1674 | $nomeRand = false; |
@@ -1811,6 +1811,8 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) | @@ -1811,6 +1811,8 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) | ||
1811 | //se o arquivo não tiver sido copiado | 1811 | //se o arquivo não tiver sido copiado |
1812 | // | 1812 | // |
1813 | $nomecopia = $dir_tmp."/".basename($meta); | 1813 | $nomecopia = $dir_tmp."/".basename($meta); |
1814 | + //para evitar que tente copiar um arquivo mapfile | ||
1815 | + $nomecopia = str_replace(".map","",$nomecopia); | ||
1814 | if(file_exists($meta)){ | 1816 | if(file_exists($meta)){ |
1815 | if(!file_exists($nomecopia)){ | 1817 | if(!file_exists($nomecopia)){ |
1816 | copy($meta,$nomecopia); | 1818 | copy($meta,$nomecopia); |
classesphp/mapa_controle.php
@@ -2554,15 +2554,9 @@ switch (strtoupper($funcao)) | @@ -2554,15 +2554,9 @@ switch (strtoupper($funcao)) | ||
2554 | break; | 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 | Function: projetaExt | 2561 | Function: projetaExt |
2568 | 2562 |
classesphp/mapa_inicia.php
@@ -102,7 +102,7 @@ Retorno: | @@ -102,7 +102,7 @@ Retorno: | ||
102 | */ | 102 | */ |
103 | function iniciaMapa() | 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 | //verifica se algum tema e restrito a determinado usuario | 107 | //verifica se algum tema e restrito a determinado usuario |
108 | //as funcoes de validacao encontram-se em funcoes_gerais.php | 108 | //as funcoes de validacao encontram-se em funcoes_gerais.php |
@@ -379,6 +379,7 @@ function iniciaMapa() | @@ -379,6 +379,7 @@ function iniciaMapa() | ||
379 | $res["editavel"] = $m->mapa->getmetadata("EDITAVEL"); | 379 | $res["editavel"] = $m->mapa->getmetadata("EDITAVEL"); |
380 | $m->mapa->setmetadata("CUSTOMIZACOESINIT",""); | 380 | $m->mapa->setmetadata("CUSTOMIZACOESINIT",""); |
381 | $m->salva(); | 381 | $m->salva(); |
382 | + restauraCon($map_file,$postgis_mapa); | ||
382 | copy($map_file,(str_replace(".map","reinc.map",$map_file))); | 383 | copy($map_file,(str_replace(".map","reinc.map",$map_file))); |
383 | copy($map_file,(str_replace(".map","seguranca.map",$map_file))); | 384 | copy($map_file,(str_replace(".map","seguranca.map",$map_file))); |
384 | ob_clean(); | 385 | ob_clean(); |