Commit a51a863baa978edc7a92c88e226a8d62e399a537

Authored by Edmar Moretti
1 parent 34ba15ad
Exists in master

Muda o nome do mapfile quando o mesmo for salvo localmente para não expor o nome…

… do diretório temporário
Showing 1 changed file with 23 additions and 16 deletions   Show diff stats
ferramentas/salvamapa/forcedownload.php
@@ -2,9 +2,16 @@ @@ -2,9 +2,16 @@
2 include(dirname(__FILE__)."/../safe.php"); 2 include(dirname(__FILE__)."/../safe.php");
3 verificaBlFerramentas(basename(dirname(__FILE__)),$i3geoBlFerramentas,false); 3 verificaBlFerramentas(basename(dirname(__FILE__)),$i3geoBlFerramentas,false);
4 // 4 //
  5 +//o usuario deve ter entrado pelo i3Geo
  6 +//
  7 +if(empty($fingerprint)){
  8 + echo "<p class='paragrafo' >Erro ao enviar o arquivo.";
  9 + return;
  10 +}
  11 +//
5 //faz uma copia temporaria do mapfile 12 //faz uma copia temporaria do mapfile
6 // 13 //
7 -$arquivo = dirname($map_file)."/mapfile_".nomeRandomico(6).".map"; 14 +$arquivo = dirname(dirname($map_file))."/mapfile_".nomeRandomico(6).".map";
8 $mapa = ms_newMapObj($map_file); 15 $mapa = ms_newMapObj($map_file);
9 $mapa->save($arquivo); 16 $mapa->save($arquivo);
10 $mapa = ms_newMapObj($arquivo); 17 $mapa = ms_newMapObj($arquivo);
@@ -22,18 +29,18 @@ for ($i=0;$i &lt; $c;++$i){ @@ -22,18 +29,18 @@ for ($i=0;$i &lt; $c;++$i){
22 if($ct != MS_INLINE && $ct != MS_WMS && $ct != MS_GRATICULE){ 29 if($ct != MS_INLINE && $ct != MS_WMS && $ct != MS_GRATICULE){
23 $l->set("connection",""); 30 $l->set("connection","");
24 $l->set("data",""); 31 $l->set("data","");
25 - }  
26 - //  
27 - //remove os metadata  
28 - //  
29 - $hashTable = $l->metadata;  
30 - $key = null;  
31 - while ($key = $hashTable->nextkey($key)){  
32 - if(!in_array(strtolower($key),array("tema","nomeoriginal"))){  
33 - //echo "Key: ".$key." value: ".$hashTable->get($key)."<br/>";  
34 - $l->setmetadata($key,"");  
35 - if($ct != MS_WMS){  
36 - $remover[] = strtoupper($key); 32 + //
  33 + //remove os metadata
  34 + //
  35 + $hashTable = $l->metadata;
  36 + $key = null;
  37 + while ($key = $hashTable->nextkey($key)){
  38 + if(!in_array(strtolower($key),array("tema","nomeoriginal"))){
  39 + //echo "Key: ".$key." value: ".$hashTable->get($key)."<br/>";
  40 + $l->setmetadata($key,"");
  41 + if($ct != MS_WMS){
  42 + $remover[] = strtoupper($key);
  43 + }
37 } 44 }
38 } 45 }
39 } 46 }
@@ -54,15 +61,15 @@ function removeCabecalho($arq,$remover){ @@ -54,15 +61,15 @@ function removeCabecalho($arq,$remover){
54 $handle = fopen($arq, "r"); 61 $handle = fopen($arq, "r");
55 if ($handle){ 62 if ($handle){
56 $cabeca = array(); 63 $cabeca = array();
57 - $cabeca[] = "MAP\n"; 64 + //$cabeca[] = "MAP\n";
58 $grava = false; 65 $grava = false;
59 while (!feof($handle)){ 66 while (!feof($handle)){
60 $linha = fgets($handle); 67 $linha = fgets($handle);
61 if(strpos(strtoupper($linha),"SYMBOLSET") !== false){ 68 if(strpos(strtoupper($linha),"SYMBOLSET") !== false){
62 - $cabeca[] = '"..'.explode($pasta,$linha)[1]; 69 + //$cabeca[] = '"..'.explode($pasta,$linha)[1];
63 } 70 }
64 if(strpos(strtoupper($linha),"FONTSET") !== false){ 71 if(strpos(strtoupper($linha),"FONTSET") !== false){
65 - $cabeca[] = '"..'.explode($pasta,$linha)[1]; 72 + //$cabeca[] = '"..'.explode($pasta,$linha)[1];
66 } 73 }
67 if(strtoupper(trim($linha)) == "LAYER"){ 74 if(strtoupper(trim($linha)) == "LAYER"){
68 $grava = true; 75 $grava = true;