Commit b639b6c491f13101b91751de932c6c4ccf80d377

Authored by Edmar Moretti
1 parent e87067f7

Correção na ferramenta filtro e colorramp. Inclusão de variável de configuração …

…em ms_configura.php que permite bloquear ferramentas
admin/admin.db
No preview for this file type
classesphp/classe_mapa.php
... ... @@ -459,7 +459,8 @@ class Mapa
459 459 if (!mb_detect_encoding($f,"UTF-8",true)){
460 460 $f = mb_convert_encoding($f,"UTF-8","ISO-8859-1");
461 461 }
462   - $ferramentas["animagif"] = json_decode($f);
  462 + $ferramentas["animagif"] = json_decode(str_replace("'",'"',$f));
  463 + //var_dump($ferramentas["animagif"]);exit;
463 464 }
464 465 $temas[] = array(
465 466 $oLayer->name,
... ...
ferramentas/animagif/exec.php
... ... @@ -37,11 +37,9 @@ $_GET = array_merge($_GET,$_POST);
37 37 //
38 38 if(empty($_GET["colunat"])){
39 39 $nmapa = ms_newMapObj($locaplic."/temas/".$_GET["tema"].".map");
40   -
41 40 $layer = $nmapa->getlayerbyname($_GET["tema"]);
42   -
43 41 $animagif = $layer->getmetadata("animagif");
44   - $animagif = json_decode($animagif,true);
  42 + $animagif = json_decode(str_replace("'",'"',$animagif),true);
45 43 $_GET["colunat"] = $animagif["colunat"];
46 44 $_GET["tempo"] = $animagif["tempo"];
47 45 $_GET["w"] = $animagif["w"];
... ... @@ -110,6 +108,10 @@ if(!in_array($operador,array("=","<",">"))){
110 108 $nulos = explode(",",$nulos);
111 109 $arqtemp = $dir_tmp."/".$nometemp;
112 110 if(file_exists($arqtemp.".gif")){
  111 + if(getimagesize($arqtemp.".gif") == false){
  112 + echo "";
  113 + exit;
  114 + }
113 115 $gifBinary = file_get_contents($arqtemp.".gif");
114 116 //retorna o gif para o navegador
115 117 header('Content-type: image/gif');
... ... @@ -191,9 +193,6 @@ if($copyright != ""){
191 193 $label->updatefromstring("LABEL POSITION lr END");
192 194 $label->updatefromstring('LABEL STYLE GEOMTRANSFORM "labelpoly" COLOR 255 255 255 END END');
193 195 }
194   -
195   -//
196   -$mapa->save($arqtemp.".map");
197 196 //adiciona ao mapa base as camadas do mapfile indicado em $tema
198 197 $nmapa = ms_newMapObj($locaplic."/temas/".$tema.".map");
199 198 $numlayers = $nmapa->numlayers;
... ... @@ -219,8 +218,6 @@ for ($i=0;$i < $numlayers;$i++){
219 218 cloneInlineSymbol($layern,$nmapa,$mapa);
220 219 ms_newLayerObj($mapa, $layern);
221 220 }
222   -
223   -$mapa->save($arqtemp.".map");
224 221 //aplica a extensao geografica
225 222 $layer = $mapa->getlayerbyname($tema);
226 223  
... ... @@ -272,10 +269,8 @@ $o->set("imagemode",MS_IMAGEMODE_RGBA);
272 269 if($transparente == "sim"){
273 270 $o->set("transparent",MS_TRUE);
274 271 }
275   -
  272 +restauraConObj($mapa,$postgis_mapa);
276 273 $mapa->save($arqtemp.".map");
277   -$mapa = ms_newMapObj($arqtemp.".map");
278   -restauraCon($arqtemp.".map",$postgis_mapa);
279 274  
280 275 /*
281 276 if(validaAcessoTemas($arqtemp.".map",false) == true){
... ... @@ -295,8 +290,7 @@ foreach($lista as $l){
295 290 }
296 291 }
297 292  
298   -//$listaunica = array("201537");
299   -
  293 +$mapa = ms_newMapObj($arqtemp.".map");
300 294 //cria as imagens para cada periodo
301 295 $layer = $mapa->getlayerbyname($tema);
302 296  
... ... @@ -308,6 +302,11 @@ if($copyright != ""){
308 302 }
309 303 $mapa->moveLayerdown(0);
310 304  
  305 +$mapa->save($arqtemp.".map");
  306 +substituiCon($mapa,$postgis_mapa);
  307 +$mapa = ms_newMapObj($arqtemp.".map");
  308 +$copyright = $mapa->getlayerbyname("copyright");
  309 +
311 310 if($copyright != ""){
312 311 $c = $copyright->getclass(0);
313 312 if($vi >= 60200){
... ... @@ -323,19 +322,23 @@ if($copyright != ""){
323 322 $imagens = array();
324 323 $duracao = array();
325 324 $objImagem = "";
  325 +
326 326 foreach($listaunica as $d){
  327 +
  328 + $layer = $mapa->getlayerbyname($tema);
327 329 if(strtoupper($colunat) == $colunat){
328 330 $filtro = "(('[$colunat]' $operador '$d'))";
329   - if($tipocolunat == "numerico"){
  331 + if($tipocolunat == "numerico" || $tipocolunat == "numero"){
330 332 $filtro = "(([$colunat] $operador $d))";
331 333 }
332 334 }
333 335 else{
334 336 $filtro = "$colunat $operador '$d'";
335   - if($tipocolunat == "numerico"){
  337 + if($tipocolunat == "numerico" || $tipocolunat == "numero"){
336 338 $filtro = "$colunat $operador $d";
337 339 }
338 340 }
  341 +
339 342 $layer->setfilter($filtro);
340 343  
341 344 $nomec = $arqtemp.$d.".png";
... ... @@ -348,16 +351,13 @@ foreach($listaunica as $d){
348 351 $classe->title = $d;
349 352 }
350 353 //$mapa->save($arqtemp."teste.map");
  354 + $mapa->save($arqtemp.".map");
351 355 if(!file_exists($nomec)){
352 356 if($objImagem == ""){
353   - //$mapa->save($arqtemp.".map");
354   - //echo $arqtemp.".map";
355 357 $objImagem = $mapa->draw();
356 358 $objImagem->saveImage($nomec);
357 359 }
358 360 else{
359   - //$mapa->save($arqtemp.".map");
360   - //echo $arqtemp.".map";
361 361 $i = $mapa->draw();
362 362 $objImagem->pasteImage($i,-1);
363 363 $objImagem->saveImage($nomec);
... ... @@ -367,7 +367,10 @@ foreach($listaunica as $d){
367 367 $duracao[] = $tempo;
368 368 //$mapa->save($arqtemp.".map");exit;
369 369 }
370   -
  370 +restauraConObj($mapa,$postgis_mapa);
  371 +$mapa->save($arqtemp.".map");
  372 +unlink($arqtemp.".map");
  373 +$mapa = null;
371 374 //junta as imagens no gif
372 375  
373 376 include("../../pacotes/gifcreator/GifCreator.php");
... ...
ferramentas/animagif/index.js
... ... @@ -313,7 +313,7 @@ i3GEOF.animagif =
313 313 p = i3GEO.configura.locaplic + "/ferramentas/animagif/manutencao.php";
314 314 par = "&g_sid=" + i3GEO.configura.sid
315 315 + "&tema=" + i3GEOF.animagif.tema
316   - + "&animagif=" + i3GEO.util.base64encode(j)
  316 + + "&animagif=" + j
317 317 + "&funcao=inclui";
318 318  
319 319 retorno =
... ...
ferramentas/animagif/manutencao.php
... ... @@ -11,7 +11,7 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){
11 11 retornaJSON("Vc nao pode realizar essa operacao. Tente fazer login novamente.");exit;
12 12 }
13 13 }
14   -$tema = $_GET["tema"];
  14 +$tema = $_POST["tema"];
15 15 error_reporting(0);
16 16 //
17 17 //faz a busca da função que deve ser executada
... ... @@ -44,7 +44,7 @@ switch (strtoupper($funcao))
44 44 $mapa = ms_newMapObj($map_file);
45 45 $l = $mapa->getlayerbyname($tema);
46 46 if($l != ""){
47   - //$l->setmetadata("animagif",base64_decode($animagif));
  47 + $l->setmetadata("animagif",$animagif);
48 48 $mapa->save($map_file);
49 49 }
50 50 $arq = $locaplic."/temas/".$tema.".map";
... ... @@ -52,7 +52,7 @@ switch (strtoupper($funcao))
52 52 $mapa = ms_newMapObj($arq);
53 53 $l = $mapa->getlayerbyname($tema);
54 54 if($l != ""){
55   - //$l->setmetadata("animagif",base64_decode($animagif));
  55 + $l->setmetadata("animagif",str_replace("\\","'",$_POST["animagif"]));
56 56 $mapa->save($arq);
57 57 removeCabecalho($arq);
58 58 }
... ...
ferramentas/blacklist.php 100644 → 100755
ferramentas/colourramp/index.php
... ... @@ -4,11 +4,14 @@
4 4 include_once(dirname(__FILE__)."/../../classesphp/class.palette.php");
5 5 $m = new palette();
6 6 $lista = implode(",",($m->listaColourRamps(dirname(__FILE__)."/../..")));
7   - if(!isset($ncores))
8   - {$ncores = 10;}
  7 + if(!isset($_GET["ncores"])){
  8 + $_GET["ncores"] = 10;
  9 + }
9 10 if(empty($_GET["locaplic"])){
10   - $locaplic = "../..";
  11 + $_GET["locaplic"] = "../..";
11 12 }
  13 +
  14 + $locaplic = $_GET["locaplic"];
12 15 ?>
13 16 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
14 17 <html>
... ... @@ -130,7 +133,7 @@ new YAHOO.widget.Button(
130 133 {onclick:{fn: function(){aplicarCores();}}}
131 134 );
132 135 $i("voltar-button").style.width = "250px"
133   -var lista = "<?php echo $_GET["lista"];?>";
  136 +var lista = "<?php echo $lista;?>";
134 137 lista = lista.split(",");
135 138 var n = lista.length;
136 139 var ins = "";
... ...
ferramentas/filtro/exec.php
... ... @@ -30,8 +30,11 @@ Inclui um filtro no tema.
30 30 include_once(dirname(__FILE__)."/../../classesphp/classe_temas.php");
31 31 //copiaSeguranca($map_file);
32 32 $m = new Temas($map_file,$tema);
33   - if(!isset($_GET["testa"])){$_GET["testa"]="";}
34   - {$retorno = $m->insereFiltro($_GET["filtro"],$_GET["testa"],"sim");}
  33 + if(!isset($_GET["testa"])){
  34 + $_GET["testa"]="";
  35 + }
  36 + $m->insereFiltro("");
  37 + $retorno = $m->insereFiltro($_GET["filtro"],$_GET["testa"],"sim");
35 38 if(strtolower($testa) != "sim"){
36 39 $m->salva();
37 40 $_SESSION["contadorsalva"]++;
... ...
ferramentas/filtro/index.js
... ... @@ -397,7 +397,7 @@ i3GEOF.filtro = {
397 397 $i(idRetorno).value = i3GEOF.filtro.formataMapserver();
398 398 }
399 399 else{
400   - p = i3GEO.configura.locaplic+"/ferramentas/filtro/exec.php?base64=sim&g_sid="+i3GEO.configura.sid+"&funcao=inserefiltro&filtro="+i3GEO.util.base64encode(filtro);
  400 + p = i3GEO.configura.locaplic+"/ferramentas/filtro/exec.php?base64=nao&g_sid="+i3GEO.configura.sid+"&funcao=inserefiltro&filtro="+filtro;
401 401 cp = new cpaint();
402 402 cp.set_response_type("JSON");
403 403 cp.set_transfer_mode('POST');
... ... @@ -415,7 +415,7 @@ i3GEOF.filtro = {
415 415 i3GEOF.filtro.aguarde.visibility = "hidden";
416 416 };
417 417 }
418   - cp.call(p,"insereFiltro",temp,"tema="+i3GEOF.filtro.tema,"testa="+testa);
  418 + cp.call(p,"insereFiltro",temp,"tema="+i3GEOF.filtro.tema+"&testa="+testa);
419 419 }
420 420 }
421 421 catch(e){
... ...
ferramentas/graficointerativo1/index.js
... ... @@ -1874,7 +1874,7 @@ i3GEOF.graficointerativo1 =
1874 1874 temp = function(retorno){
1875 1875 i3GEO.Interface.atualizaTema(retorno,tema);
1876 1876 };
1877   - cp.call(p,"insereFiltro",temp,"tema="+tema,"filtro=");
  1877 + cp.call(p,"insereFiltro",temp,"tema="+tema+"&filtro=");
1878 1878 }
1879 1879 }
1880 1880 };
... ...
ferramentas/identifica/index.js
... ... @@ -1168,11 +1168,11 @@ i3GEOF.identifica =
1168 1168 i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden";
1169 1169 i3GEO.Interface.atualizaTema(retorno, tema);
1170 1170 }, p =
1171   - i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=sim&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", cp =
  1171 + i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=nao&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", cp =
1172 1172 new cpaint();
1173 1173 cp.set_response_type("JSON");
1174 1174 cp.set_transfer_mode('POST');
1175   - cp.call(p, "insereFiltro", temp, "tema=" + tema, "filtro=" + i3GEO.util.base64encode(filtro));
  1175 + cp.call(p, "insereFiltro", temp, "tema=" + tema + "&filtro=" + filtro);
1176 1176 },
1177 1177 removeFiltro : function(tema, idjanela) {
1178 1178 if (i3GEOF.identifica.propJanelas[idjanela].visibility === "visible") {
... ... @@ -1187,7 +1187,7 @@ i3GEOF.identifica =
1187 1187 new cpaint();
1188 1188 cp.set_response_type("JSON");
1189 1189 cp.set_transfer_mode('POST');
1190   - cp.call(p, "insereFiltro", temp, "tema=" + tema, "filtro=");
  1190 + cp.call(p, "insereFiltro", temp, "tema=" + tema + "&filtro=");
1191 1191 },
1192 1192 adicionaPontoRegiao : function(idjanela) {
1193 1193 var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid=" + i3GEO.configura.sid, tema =
... ...
ferramentas/salvamapa/index.js
... ... @@ -98,7 +98,6 @@ i3GEOF.salvaMapa = {
98 98 local = i3GEO.configura.locaplic+"/../ms_tmp"+local[1];
99 99 onde.innerHTML = "" +
100 100 "<a style='line-height:20px;font-size:12px;' href='"+down+"' target='_blank' >"+$trad('baixaArquivo',i3GEOF.salvaMapa.dicionario)+"</a><br>" +
101   - "<a style='line-height:20px;font-size:12px;' href='"+local+"' target='_blank' >"+$trad('veArquivo',i3GEOF.salvaMapa.dicionario)+"</a><br>" +
102 101 "<a style='line-height:20px;font-size:12px;' href='"+teste+"' target='_blank' >"+$trad('testaArquivo',i3GEOF.salvaMapa.dicionario)+"</a>";
103 102 }
104 103 catch(erro){i3GEO.janela.tempoMsg(erro);}
... ...
ferramentas/selecao/index.js
... ... @@ -1198,11 +1198,11 @@ i3GEOF.selecao =
1198 1198 p,
1199 1199 "selecaoPoli",
1200 1200 retorna,
1201   - "xs=" + xs,
1202   - "ys=" + ys,
1203   - "tema=" + tema,
1204   - "tipo=" + $i("i3GEOselecaotipoOperacao").value,
1205   - "buffer=" + $i("i3GEOselecaotoleranciapt").value);
  1201 + "xs=" + xs
  1202 + + "&ys=" + ys
  1203 + + "&tema=" + tema
  1204 + + "&tipo=" + $i("i3GEOselecaotipoOperacao").value
  1205 + + "&buffer=" + $i("i3GEOselecaotoleranciapt").value);
1206 1206 }
1207 1207 },
1208 1208 /*
... ...
temas/_llocali.map 100755 → 100644
1 1 MAP
2 2 FONTSET "../symbols/fontes.txt"
3 3 SYMBOLSET "../symbols/simbolosv6.sym"
4   -
5 4 LAYER
6 5 CONNECTION ""
7 6 DATA "/var/www/i3geo/aplicmap/dados/locali.shp"
8 7 METADATA
9 8 "METAESTAT_ID_MEDIDA_VARIAVEL" ""
10   - "cache" "SIM"
11 9 "TIP" "TIPO,NOMELOC,ANOCRIA"
12   - "LTEMPOITEMDESCRICAO" "TIPO"
  10 + "cache" "SIM"
13 11 "CLASSE" "SIM"
  12 + "LTEMPOITEMDESCRICAO" "TIPO"
14 13 "LTEMPOITEMINICIO" "ANOCRIA"
15   - "LTEMPOITEMTIP" "ANOCRIA"
16 14 "permitekmz" "sim"
17   - "LTEMPOITEMTITULO" "NOMELOC"
  15 + "LTEMPOITEMTIP" "ANOCRIA"
18 16 "ITENSDESC" "Município,TIPO,Localidade,ANOCRIA"
19   - "TILES" "SIM"
  17 + "LTEMPOITEMTITULO" "NOMELOC"
20 18 "ITENSLINK" ",,,"
  19 + "TILES" "SIM"
21 20 "METAESTAT_CODIGO_TIPO_REGIAO" ""
22   - "LTEMPOFORMATODATA" "iso8601"
23 21 "permitedownload" "sim"
  22 + "LTEMPOFORMATODATA" "iso8601"
24 23 "permitecomentario" "SIM"
25 24 "metaestat" ""
26 25 "download" "SIM"
27 26 "itembuscarapida" "NOMELOC"
28 27 "ITENS" "NOMEMUN,TIPO,NOMELOC,ANOCRIA"
29   - "transitioneffect" "NAO"
30   - "permiteogc" "sim"
31 28 "permitekml" "sim"
  29 + "permiteogc" "sim"
  30 + "transitioneffect" "NAO"
32 31 "TEMA" "Localidades (usar com timeline) para teste"
33 32 "cortepixels" "30"
34 33 "LTEMPOCONVENCODE" "SIM"
... ...
temas/_llocalianimagif.map 100755 → 100644
... ... @@ -10,7 +10,7 @@ MAP
10 10 "cache" "SIM"
11 11 "CLASSE" "SIM"
12 12 "LTEMPOITEMDESCRICAO" "TIPO"
13   - "animagif" ""
  13 + "animagif" "{'colunat':'ANOCRIA','tipocolunat':'numero','tempo':'40','w':'500','h':'500','cache':'sim','mapext':'-159.521484375 -89.263671875 114.521484375 46.263671875','legenda':'sim','transparente':'sim','operador':'','nulos':'','auto':'sim','exec':'nao'}"
14 14 "LTEMPOITEMINICIO" "ANOCRIA"
15 15 "permitekmz" "sim"
16 16 "LTEMPOITEMTIP" "ANOCRIA"
... ...
temas/a.map
... ... @@ -1,89 +0,0 @@
1   -MAP
2   - FONTSET "../symbols/fontes.txt"
3   - SYMBOLSET "../symbols/simbolosv6.sym"
4   - LAYER
5   - CONNECTION ""
6   - DATA "/var/www/i3geo/aplicmap/dados/biomas.shp"
7   - METADATA
8   - "TIP" "CD_LEGENDA"
9   - "CACHE" "sim"
10   - "CLASSE" "SIM"
11   - "permitekmz" "sim"
12   - "ITENSDESC" "Bioma Teste de acentuação"
13   - "ESCALA" "1000000"
14   - "TILES" "SIM"
15   - "extensao" "-76 -39 -29 9"
16   - "permitedownload" "sim"
17   - "download" "sim"
18   - "itembuscarapida" "CD_LEGENDA"
19   - "ITENS" "CD_LEGENDA"
20   - "transitioneffect" "SIM"
21   - "permiteogc" "sim"
22   - "permitekml" "sim"
23   - "TEMA" "Biomas SHP (acentução) teste"
24   - END # METADATA
25   - NAME "a"
26   - PROCESSING "ITEMS=CD_LEGENDA"
27   - PROCESSING "LABEL_NO_CLIP=True"
28   - PROCESSING "POLYLINE_NO_CLIP=True"
29   - STATUS DEFAULT
30   - TEMPLATE "none.htm"
31   - TILEITEM "location"
32   - TYPE POLYGON
33   - UNITS METERS
34   - CLASS
35   - NAME "CAATINGA"
36   - EXPRESSION ('[CD_LEGENDA]'eq'CAATINGA')
37   - STYLE
38   - COLOR 4 180 226
39   - OUTLINECOLOR 255 255 255
40   - END # STYLE
41   - TITLE ""
42   - END # CLASS
43   - CLASS
44   - NAME "PAMPA area > 5"
45   - EXPRESSION ('[CD_LEGENDA]'eq'PAMPA area > 5')
46   - STYLE
47   - COLOR 116 220 127
48   - OUTLINECOLOR 255 255 255
49   - END # STYLE
50   - TITLE ""
51   - END # CLASS
52   - CLASS
53   - NAME "CERRADO"
54   - EXPRESSION ('[CD_LEGENDA]'eq'CERRADO')
55   - STYLE
56   - COLOR 202 199 25
57   - OUTLINECOLOR 255 255 255
58   - END # STYLE
59   - TITLE ""
60   - END # CLASS
61   - CLASS
62   - NAME "PANTANAL"
63   - EXPRESSION ('[CD_LEGENDA]'eq'PANTANAL')
64   - STYLE
65   - COLOR 68 130 30
66   - OUTLINECOLOR 255 255 255
67   - END # STYLE
68   - TITLE ""
69   - END # CLASS
70   - CLASS
71   - NAME "AMAZÔNIA"
72   - EXPRESSION ('[CD_LEGENDA]'eq'AMAZÔNIA')
73   - STYLE
74   - COLOR 23 2 150
75   - OUTLINECOLOR 255 255 255
76   - END # STYLE
77   - TITLE ""
78   - END # CLASS
79   - CLASS
80   - NAME "MATA ATLÂNTICA"
81   - EXPRESSION ('[CD_LEGENDA]'eq'MATA ATLÂNTICA')
82   - STYLE
83   - COLOR 187 96 164
84   - OUTLINECOLOR 255 255 255
85   - END # STYLE
86   - TITLE ""
87   - END # CLASS
88   - END # LAYER
89   -END # MAP