Commit 59319cf61d7bb104ca0f3064c4d3f58e97f4ad54
1 parent
33d95136
Exists in
master
and in
7 other branches
Revisão do código para uso de sanitização de variáveis
Showing
27 changed files
with
91 additions
and
349 deletions
Show diff stats
admin/admin.db
No preview for this file type
ajuda_usuario.php
... | ... | @@ -42,7 +42,7 @@ idcategoria - id da categoria. Lista apenas uma categoria |
42 | 42 | |
43 | 43 | idajuda - id da funcionalidade. Lista apenas uma funcionalidade |
44 | 44 | */ |
45 | -include("classesphp/pega_variaveis.php"); | |
45 | +include_once (dirname(__FILE__)."/classesphp/sani_request.php"); | |
46 | 46 | include("ms_configura.php"); |
47 | 47 | ?> |
48 | 48 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
... | ... | @@ -153,9 +153,8 @@ A:hover { |
153 | 153 | <div class="mascaraPrincipal" id="divGeral"> |
154 | 154 | <img src="imagens/i3geo1.jpg" /> |
155 | 155 | <p style='font-size:16px'>Documentação do usuário.</p> |
156 | - <p><?php echo $mensagemInicia;?></p> | |
157 | 156 | <?php |
158 | - if (isset($idcategoria)) | |
157 | + if (isset($_GET["idcategoria"])) | |
159 | 158 | { |
160 | 159 | echo "<p>Para ver toda a documentação, "; |
161 | 160 | echo "clique <a href='ajuda_usuario.php' >aqui</a></p>"; |
... | ... | @@ -175,8 +174,8 @@ i3GEO.configura.locaplic = i3GEO.util.protocolo() + "://" |
175 | 174 | + window.location.host + "/i3geo"; |
176 | 175 | i3GEO.idioma.IDSELETOR = "bandeiras"; |
177 | 176 | i3GEO.idioma.mostraSeletor(); |
178 | -var idcategoria = "<?php echo $idcategoria;?>"; | |
179 | -var idajuda = "<?php echo $idajuda;?>"; | |
177 | +var idcategoria = "<?php echo $_GET["idcategoria"];?>"; | |
178 | +var idajuda = "<?php echo $_GET["idajuda"];?>"; | |
180 | 179 | if(screen.availWidth > 700){ |
181 | 180 | document.getElementById("divGeral").style.width = "700px"; |
182 | 181 | } | ... | ... |
classesphp/classe_selecao.php
... | ... | @@ -730,10 +730,10 @@ $shp_atual - Indices dos elementos j&aacute; selecionados. |
730 | 730 | $indxlayer = $this->layer->index; |
731 | 731 | $shp = array_merge($shpi,$shp_atual); |
732 | 732 | $shp = array_unique($shp); |
733 | + | |
733 | 734 | $this->mapa->freequery($indxlayer); |
734 | 735 | foreach ($shp as $indx) |
735 | 736 | {@$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} |
736 | - //echo $this->layer->getNumresults(); | |
737 | 737 | $this->mapa->savequery($this->qyfile); |
738 | 738 | $this->serializeQ($this->qyfileTema,$shp); |
739 | 739 | return("ok"); | ... | ... |
classesphp/parse_cgi.php
... | ... | @@ -51,25 +51,34 @@ Exemplo: |
51 | 51 | http://localhost/i3geo/classesphp/parse_cgi.php?g_sid=dgge4877dhhhgrjjey&map_size=500 500 |
52 | 52 | */ |
53 | 53 | error_reporting(0); |
54 | -include_once("pega_variaveis.php"); | |
54 | +include_once (dirname(__FILE__)."/classesphp/sani_request.php"); | |
55 | +$_GET = array_merge($_GET,$_POST); | |
55 | 56 | include_once ("carrega_ext.php"); |
56 | 57 | include_once("funcoes_gerais.php"); |
57 | -$temp = $mapext; | |
58 | +$temp = $_GET["mapext"]; | |
58 | 59 | session_name("i3GeoPHP"); |
59 | -session_id($g_sid); | |
60 | +session_id($_GET["g_sid"]); | |
60 | 61 | session_start(); |
61 | 62 | $mapext = $temp; |
62 | 63 | $map_file = $_SESSION["map_file"]; |
63 | - | |
64 | +$fingerprint = $_SESSION["fingerprint"]; | |
64 | 65 | include(dirname(__FILE__)."/../ms_configura.php"); |
65 | 66 | if(isset($fingerprint)) |
66 | 67 | { |
67 | 68 | if (md5('I3GEOSEC' . $_SERVER['HTTP_USER_AGENT'] . session_id()) != $fingerprint) |
68 | 69 | {exit;} |
69 | 70 | } |
70 | -if (!isset($map_imagecolor)) $map_imagecolor = "-1 -1 -1"; | |
71 | +if (!isset($_GET["map_imagecolor"])){ | |
72 | + $map_imagecolor = "-1 -1 -1"; | |
73 | +} else { | |
74 | + $map_imagecolor = $_GET["map_imagecolor"]; | |
75 | +} | |
71 | 76 | |
72 | -if (!isset($map_transparent)) $map_transparent = "ON"; | |
77 | +if (!isset($map_transparent)){ | |
78 | + $map_transparent = "ON"; | |
79 | +} else { | |
80 | + $map_transparent = $_GET["map_transparent"]; | |
81 | +} | |
73 | 82 | // |
74 | 83 | //faz uma c�pia do mapfile para poder manipular sem afetar omapfile atual usado pelo i3geo |
75 | 84 | // |
... | ... | @@ -80,6 +89,7 @@ $map_filen = str_replace(".map","",$map_filen).".map"; |
80 | 89 | copy($map_file,$map_filen); |
81 | 90 | substituiCon($map_filen,$postgis_mapa); |
82 | 91 | $map = ms_newMapObj($map_filen); |
92 | +restauraCon($map_filen,$postgis_mapa); | |
83 | 93 | $layersNames = $map->getalllayernames(); |
84 | 94 | foreach ($layersNames as $layerName) |
85 | 95 | { |
... | ... | @@ -99,14 +109,14 @@ foreach ($layersNames as $layerName) |
99 | 109 | } |
100 | 110 | } |
101 | 111 | } |
102 | -if(isset($map_size)) | |
112 | +if(isset($_GET["map_size"])) | |
103 | 113 | { |
104 | - $map_size = explode(",",$map_size); | |
114 | + $map_size = explode(",",$_GET["map_size"]); | |
105 | 115 | $map->setsize($map_size[0],$map_size[1]); |
106 | 116 | } |
107 | -if(isset($mapext)) | |
117 | +if(isset($_GET["mapext"])) | |
108 | 118 | { |
109 | - $mapext = explode(" ",$mapext); | |
119 | + $mapext = explode(" ",$_GET["mapext"]); | |
110 | 120 | $map->setExtent($mapext[0],$mapext[1],$mapext[2],$mapext[3]); |
111 | 121 | } |
112 | 122 | //$map->save($map_file); | ... | ... |
classesphp/wscliente.php
... | ... | @@ -46,15 +46,24 @@ Exemplo: |
46 | 46 | |
47 | 47 | http://localhost/i3geo/classesphp/wscliente.php?funcao=listaRSSws&rss=http://localhost/i3geo/admin/xmlservicosws.php&g_sid=&cpaint_function=listaRSSws&cpaint_response_type=JSON |
48 | 48 | */ |
49 | -include_once("pega_variaveis.php"); | |
49 | +include_once (dirname(__FILE__)."/sani_request.php"); | |
50 | +$_GET = array_merge($_GET,$_POST); | |
50 | 51 | include_once("lews/wms_functions.php"); |
51 | 52 | include_once(dirname(__FILE__)."/../pacotes/cpaint/cpaint2.inc.php"); |
52 | 53 | include_once("carrega_ext.php"); |
53 | 54 | include(dirname(__FILE__)."/../ms_configura.php"); |
54 | 55 | $cp = new cpaint(); |
56 | + | |
57 | +$onlineresource = $_GET["onlineresource"]; | |
58 | +$tipo = $_GET["tipo"]; | |
59 | +$servico = $_GET["servico"]; | |
60 | +$param = $_GET["param"]; | |
61 | +$funcaows = $_GET["funcaows"]; | |
62 | +$rss = $_GET["rss"]; | |
55 | 63 | // |
56 | 64 | //busca o getcapabilities de um wms |
57 | 65 | // |
66 | +$funcao = $_GET["funcao"]; | |
58 | 67 | if ($funcao == "getcapabilities") |
59 | 68 | { |
60 | 69 | $cp->register('getcapabilities'); | ... | ... |
exemplos/gm1.php
1 | -<?php | |
2 | -include_once(dirname(__FILE__)."/../classesphp/pega_variaveis.php"); | |
3 | -?> | |
4 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
5 | 2 | <html> |
6 | 3 | <head> |
... | ... | @@ -70,7 +67,7 @@ include_once(dirname(__FILE__)."/../classesphp/pega_variaveis.php"); |
70 | 67 | <script type="text/javascript"> |
71 | 68 | i3GEO.configura.locaplic = i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo"; |
72 | 69 | |
73 | -i3GEO.configura.mashuppar = "&mapext=<?php echo $mapext;?>&temasa=<?php echo $temasa;?>&layers=<?php echo $layers;?>"; | |
70 | +i3GEO.configura.mashuppar = ""; | |
74 | 71 | |
75 | 72 | i3GEO.Interface.ATUAL = "googlemaps"; |
76 | 73 | i3GEO.Interface.IDCORPO = "contemImg"; | ... | ... |
ferramentas/animagif/exec.php
ferramentas/carregamapa/upload.php
... | ... | @@ -83,6 +83,7 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) |
83 | 83 | } |
84 | 84 | } |
85 | 85 | $map->save($map_file); |
86 | + restauraCon($map_file,$postgis_mapa); | |
86 | 87 | $e = $mapt->extent; |
87 | 88 | $extatual = $e->minx." ".$e->miny." ".$e->maxx." ".$e->maxy; |
88 | 89 | echo "<p class='paragrafo' >Ok. redesenhando."; | ... | ... |
ferramentas/heatmap/funcoes.php
ferramentas/imprimir/a4lpaisagempdf.php
... | ... | @@ -37,9 +37,8 @@ $nomes = nomeRandomico(); |
37 | 37 | $map = ms_newMapObj($map_file); |
38 | 38 | $temp = str_replace(".map","xxx.map",$map_file); |
39 | 39 | $map->save($temp); |
40 | -substituiCon($temp,$postgis_mapa); | |
41 | 40 | $map = ms_newMapObj($temp); |
42 | - | |
41 | +restauraCon($temp,$postgis_mapa); | |
43 | 42 | if($map->getmetadata("interface") == "googlemaps"){ |
44 | 43 | $proj4 = pegaProjecaoDefault("proj4"); |
45 | 44 | $map->setProjection($proj4); |
... | ... | @@ -83,7 +82,7 @@ foreach ($temas as $tema) |
83 | 82 | $map->save($temp); |
84 | 83 | removeLinha("classeNula",$temp); |
85 | 84 | $map = ms_newMapObj($temp); |
86 | - | |
85 | +substituiCon($temp,$postgis_mapa); | |
87 | 86 | $o = $map->outputformat; |
88 | 87 | if($mapexten != ""){ |
89 | 88 | $ext = explode(" ",$mapexten); | ... | ... |
ferramentas/imprimir/aggpng.php
ferramentas/imprimir/geotif.php
... | ... | @@ -107,6 +107,7 @@ foreach ($temas as $tema) |
107 | 107 | $map->save($temp); |
108 | 108 | removeLinha("classeNula",$temp); |
109 | 109 | $map = ms_newMapObj($temp); |
110 | +substituiCon($temp,$postgis_mapa); | |
110 | 111 | $o = $map->outputformat; |
111 | 112 | if($mapexten != ""){ |
112 | 113 | $ext = explode(" ",$mapexten); | ... | ... |
ferramentas/imprimir/geraimagens.php
ferramentas/imprimir/jpeg.php
ferramentas/imprimir/svg.php
... | ... | @@ -131,7 +131,7 @@ for ($i=0;$i < $numlayers;$i++) |
131 | 131 | $map->save($temp); |
132 | 132 | removeLinha("classeNula",$temp); |
133 | 133 | $map = ms_newMapObj($temp); |
134 | - | |
134 | +substituiCon($temp,$postgis_mapa); | |
135 | 135 | $o = $map->outputformat; |
136 | 136 | if($mapexten != ""){ |
137 | 137 | $ext = explode(" ",$mapexten); | ... | ... |
ferramentas/inicia.php
... | ... | @@ -36,34 +36,15 @@ if(!empty($g_sid)){ |
36 | 36 | $tmpurl = $_SESSION["tmpurl"]; |
37 | 37 | $map_file = $_SESSION["map_file"]; |
38 | 38 | $mapext = $_SESSION["mapext"]; |
39 | - $dir_tmp = $_SESSION["dir_tmp"] ; | |
40 | - $cachedir = $_SESSION["cachedir"]; | |
41 | - $emailInstituicao = $_SESSION["emailInstituicao"]; | |
42 | - $locmapserv = $_SESSION["locmapserv"]; | |
43 | 39 | $locaplic = $_SESSION["locaplic"]; |
44 | - $R_path = $_SESSION["R_path"]; | |
45 | 40 | $mapext = $_SESSION["mapext"]; |
46 | - $debug = $_SESSION["debug"]; | |
47 | 41 | $ler_extensoes = $_SESSION["ler_extensoes"]; |
48 | - $postgis_mapa = $_SESSION["postgis_mapa"]; | |
49 | 42 | $perfil = $_SESSION["perfil"]; |
50 | - $navegadoresLocais = $_SESSION["navegadoresLocais"]; | |
51 | - $utilizacgi = $_SESSION["utilizacgi"]; | |
52 | - $tituloInstituicao = $_SESSION["tituloInstituicao"]; | |
53 | - $expoeMapfile = $_SESSION["expoeMapfile"]; | |
54 | - $googleApiKey = $_SESSION["googleApiKey"]; | |
55 | - $mensagemInicia = $_SESSION["mensagemInicia"]; | |
56 | - $interfacePadrao = $_SESSION["interfacePadrao"]; | |
57 | 43 | $interface = $_SESSION["interface"]; |
58 | 44 | $kmlurl = $_SESSION["kmlurl"]; |
59 | 45 | $mapdir = $_SESSION["mapdir"]; |
60 | 46 | $imgdir = $_SESSION["imgdir"]; |
61 | 47 | $contadorsalva = $_SESSION["contadorsalva"]; |
62 | - $i3georendermode = $_SESSION["i3georendermode"]; | |
63 | - $saikuUrl = $_SESSION["saikuUrl"]; | |
64 | - //sao arrays | |
65 | - $postgis_mapa = $_SESSION["postgis_mapa"]; | |
66 | - $statusFerramentas = $_SESSION["statusFerramentas"]; | |
67 | 48 | } |
68 | 49 | include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); |
69 | 50 | if(isset($fingerprint) && !empty($g_sid)) { |
... | ... | @@ -83,9 +64,11 @@ if(!substituiCon($map_file,$postgis_mapa)){ |
83 | 64 | cpjson("erro",$cp); |
84 | 65 | return; |
85 | 66 | } |
67 | +// | |
86 | 68 | function redesenhaMapa() |
87 | 69 | { |
88 | 70 | global $map_file,$tipoimagem,$cp,$postgis_mapa,$utilizacgi,$locmapserv,$interface,$mapexten; |
71 | + substituiCon($map_file,$postgis_mapa); | |
89 | 72 | if($tipoimagem != "nenhum" && $tipoimagem != "") |
90 | 73 | {$utilizacgi = "nao";} |
91 | 74 | if (connection_aborted()){exit();} | ... | ... |
ferramentas/markercluster/funcoes.php
ferramentas/tabela/relatorio.php
... | ... | @@ -62,6 +62,7 @@ foreach($temp as $t) |
62 | 62 | if($itemagruparel != "" && !in_array($itemagruparel,$itensrel)) |
63 | 63 | {$itensrel[] = $itemagruparel;} |
64 | 64 | $mapa = ms_newMapObj($map_file); |
65 | +substituiCon($temp,$postgis_mapa); | |
65 | 66 | if($ext && $ext != ""){ |
66 | 67 | $e = explode(" ",$ext); |
67 | 68 | $extatual = $mapa->extent; | ... | ... |
ferramentas/teste.phtml
... | ... | @@ -1,256 +0,0 @@ |
1 | -<?php | |
2 | -//Utilize para testar a carga de uma ferramenta | |
3 | -//exemplos: | |
4 | -//http://localhost/i3geo/ferramentas/teste.phtml?f=i3GEO.analise.dialogo.melhorcaminho() | |
5 | -//http://localhost/i3geo/ferramentas/teste.phtml?f=i3GEO.analise.dialogo.melhorcaminho%28%29&temasa=_lcusto&layers=_lcusto&mapext=-50.185547%20-16.918945%20-33.200684%20-8.843994 | |
6 | -?> | |
7 | - | |
8 | -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
9 | -<html> | |
10 | -<head> | |
11 | -<meta http-equiv="Category" content="i3Geo Mapa interativo MMA geoprocessamento sig mobile"> | |
12 | -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
13 | -<title>i3GEO - OpenLayers</title> | |
14 | -<script src="../classesjs/i3geonaocompacto.js"></script> | |
15 | -<script src="../pacotes/openlayers/OpenLayers2131.js.php"></script> | |
16 | -<link rel="stylesheet" type="text/css" href="../css/black.css"> | |
17 | -<style> | |
18 | -.olControlEditingToolbar1 div { | |
19 | - background-image: url(../mashups/openlayers.png); | |
20 | - background-repeat: no-repeat; | |
21 | - float: right; | |
22 | - right: 50px; | |
23 | - height: 29px; | |
24 | - margin: 2px; | |
25 | - width: 29px; | |
26 | - cursor: pointer; | |
27 | - top: 10px; | |
28 | -} | |
29 | -</style> | |
30 | -</head> | |
31 | -<body id="i3geo" style='margin-left: 7px; background: white;'> | |
32 | - <!-- inclui o nome do usuario logado --> | |
33 | - <div id="i3GEONomeLogin" style="position: absolute; left: 10px; top: 12px; font-size: 11px; z-index: 50000"></div> | |
34 | - <table id='mst' summary="" style='display: none;' width=100% cellspacing='0'> | |
35 | - <tr> | |
36 | - <td id="contemMenu" style="background: black; height: 30px; text-align: right; border-width: 0pt 0pt 1px; border-color: rgb(240, 240, 240)"> | |
37 | - <!--menu suspenso--> | |
38 | - <div id="menus" style="height: 30px;"></div> | |
39 | - </td> | |
40 | - </tr> | |
41 | - <tr> | |
42 | - <td style="vertical-align: top; border-width: 0px;"> | |
43 | - <table width="100%" style="vertical-align: top; border-width: 0px"> | |
44 | - <tr> | |
45 | - <td class=verdeclaro id=contemImg> | |
46 | - <div id=corpoMapa style="position: relative; background-image: url('../imagens/i3geo1bw.jpg');"></div> | |
47 | - </td> | |
48 | - </tr> | |
49 | - </table> | |
50 | - </td> | |
51 | - </tr> | |
52 | - <tr> | |
53 | - <td> | |
54 | - <table style="width: 100%; height: 28px"> | |
55 | - <tr> | |
56 | - <td class=fundoRodape style="width: 25%"> | |
57 | - <!-- aqui será incluída a escala numérica --> | |
58 | - <div id=escala style="margin: auto; text-align: right; left: 15px;"></div> | |
59 | - </td> | |
60 | - <td class=fundoRodape style="width: 5%"></td> | |
61 | - <td class=fundoRodape style="width: 40%"> | |
62 | - <!-- aqui será incluído o gadget que mostra a coordenada geográfica da posição do mouse --> | |
63 | - <div id=localizarxy style="margin: auto; text-align: left; font-size: 10px; display: inline-table"></div> | |
64 | - </td> | |
65 | - <td class=fundoRodape style="width: 20%"> | |
66 | - <!-- botão de compartilhamento em redes sociais--> | |
67 | - <!--<div id=i3GEOcompartilhar style="width: 170px; margin: auto; text-align: left; padding-top: 1px"></div> --> | |
68 | - <!-- aqui será incluído o contador de tempo quando o temporizador de redesenho do mapa estiver ativo --> | |
69 | - <div id=tempoRedesenho style="z-index: 100; position: absolute; top: 0px; color: green; background-color: black; width: 50px; display: none"></div> | |
70 | - </td> | |
71 | - <!-- aqui serão incluídas as bandeiras que permitem a troca de idioma --> | |
72 | - <td class=fundoRodape style="width: 10%;"> | |
73 | - <div id=seletorIdiomas style="right: 15px;"></div> | |
74 | - </td> | |
75 | - </tr> | |
76 | - </table> | |
77 | - </td> | |
78 | - </tr> | |
79 | - </table> | |
80 | - <table id="i3GEOlogoMarca" style='margin: 0px auto; box-shadow: 0 1px 13px gray; border-radius: 5px;'> | |
81 | - <tr> | |
82 | - <td style="height: 30px"> | |
83 | - <div id=versaoi3geo></div> | |
84 | - <h2 style="font-weight: normal; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;">i3Geo - Software livre para criação de mapas interativos e geoprocessamento</h2> | |
85 | - <h3 style="font-weight: normal; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;">Baseado no Mapserver, é licenciado sob GPL e integra o Portal do Software Público Brasileiro</h3> | |
86 | - </td> | |
87 | - </tr> | |
88 | - <tr> | |
89 | - <td style="padding: 10px;"> | |
90 | - <img style="width: 560px; height: 81px" alt="" src='../imagens/logo_inicio.png'> | |
91 | - </td> | |
92 | - </tr> | |
93 | - <tr> | |
94 | - <td> | |
95 | - <!-- | |
96 | - <script id="ohloh" type="text/javascript" src="http://www.ohloh.net/p/150688/widgets/project_users.js?style=red"></script> | |
97 | - --> | |
98 | - </td> | |
99 | - </tr> | |
100 | - </table> | |
101 | - | |
102 | - <div id="i3GEOguiaMovel" style="visibility: hidden; position: absolute; display: block; border: 0px solid white; text-align: left; z-index: 2000; background-color: none"> | |
103 | - <div style="cursor: pointer; position: absolute; top: 50%; margin-top: -65px; width: 30px; z-index: 5000; left: 18px; background-color: lightgray; border: 1px solid lightgray; border-radius: 5px; opacity: 0.8; box-shadow: -1px 0px 1px 1px rgba(200, 200, 200, 0.81)"> | |
104 | - <!-- <img src='../imagens/openbars1.png' style="width: 48px; position: absolute; left: -16px; height: 418px; top: -160px;">--> | |
105 | - <div id="iconeGuia_temas"></div> | |
106 | - <div id="iconeGuia_adiciona" style="margin-top: 3px;"></div> | |
107 | - <div id="iconeGuia_legenda" style="margin-top: 3px;"></div> | |
108 | - </div> | |
109 | - | |
110 | - <!-- | |
111 | - <img id="i3GEOguiaMovelPuxador" onclick='i3GEO.guias.guiaMovel.abreFecha()' style='z-index:2;border:solid 0px white;left:0px;position:absolute;top:0px' width='0px' src='../imagens/openbars.png' > | |
112 | - --> | |
113 | - <div id="i3GEOguiaMovelMolde" style="top: 0px; box-shadow: 0 2px 10px 0 #888888; position: absolute; display: none; border: 0px solid white; text-align: left; z-index: 1000; background-color: gray"> | |
114 | - <!-- | |
115 | - <div id="i3GEOguiaMovelIcones" style='overflow:none;left:0px;display:none;position:absolute;top:0px;text-align:center;height:0px;width:0px;border:solid 0px white;background-color:white' ></div> | |
116 | - --> | |
117 | - <div id="i3GEOguiaMovelConteudo" style='top: 10px; overflow: auto; display: none; position: absolute; border-color: gray; border-width: 0px 0 0px 0px; left: 0px; height: 0px; background-color: white'> | |
118 | - <div id='guia1obj' style='display: none;'> | |
119 | - <!-- Esta div acrescenta a opção de busca rápida, caso vc queira colocá-la em um lugar específico --> | |
120 | - <div style='left: 5px; top: 10px; width: 150px;' id=buscaRapida></div> | |
121 | - <!-- Esta div acrescenta a lista de propriedades do mapa --> | |
122 | - <div id=listaPropriedades style='top: 15px;'></div> | |
123 | - <!-- Esta div acrescenta a lista de de camadas do tipo 'baselayers' específicas da interface Openlayers. Veja também a opção i3GEO.Interface.openlayers.GADGETS.LayerSwitcher --> | |
124 | - <div id=listaLayersBase style='top: 15px;'></div> | |
125 | - <!-- Esta div acrescenta a lista de de camadas disponíveis no mapa atual --> | |
126 | - <div id=listaTemas style='top: 15px;'></div> | |
127 | - </div> | |
128 | - <div id='guia2obj' style='display: none;'> | |
129 | - Aguarde... | |
130 | - <img alt="" src="../imagens/branco.gif" width=248 /> | |
131 | - </div> | |
132 | - <div id='guia4obj' style='display: none; text-align: left'> | |
133 | - <div id='legenda' style='text-align: left'></div> | |
134 | - </div> | |
135 | - <!-- | |
136 | - <div id='guia5obj' style='display:none;text-align:left'><div id='banners' style='overflow:auto;text-align:left'>Aguarde...</div></div> | |
137 | - --> | |
138 | - </div> | |
139 | - </div> | |
140 | - </div> | |
141 | - <script> | |
142 | - i3GEO.configura.locaplic = i3GEO.util.protocolo() + "://" | |
143 | - + window.location.host + "/i3geo"; | |
144 | - i3GEO.configura.autotamanho = false; | |
145 | - i3GEO.Interface.ATUAL = "openlayers"; | |
146 | - i3GEO.Interface.IDCORPO = "contemImg"; | |
147 | - i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.permiteLogin = true; | |
148 | - | |
149 | - i3GEO.Interface.openlayers.TILES = true; | |
150 | - | |
151 | - i3GEO.configura.guardaExtensao = false; | |
152 | - i3GEO.gadgets.PARAMETROS.mostraMenuSuspenso.finaliza = 'if($i("omenudataInterface1")){i3GEOoMenuBar.getMenuItem("omenudataInterface1").cfg.setProperty("text", " ");}'; | |
153 | - | |
154 | - i3GEO.cria(); | |
155 | - i3GEO.configura.mapaRefDisplay = "none"; | |
156 | - i3GEO.barraDeBotoes.TIPO = "olhodepeixe"; | |
157 | - //ajusta o deslocamento da barra de botoes | |
158 | - i3GEO.barraDeBotoes.OFFSET = 11; | |
159 | - //ajusta a posicao da barra de botoes no IE | |
160 | - if(navm){ | |
161 | - i3GEO.barraDeBotoes.OFFSET = 5; | |
162 | - } | |
163 | - if(chro){ | |
164 | - i3GEO.barraDeBotoes.OFFSET = 15; | |
165 | - } | |
166 | - | |
167 | - i3GEO.configura.oMenuData["submenus"]["janelas"] = []; | |
168 | - i3GEO.ajuda.ATIVAJANELA = false; | |
169 | - i3GEO.idioma.IDSELETOR = "seletorIdiomas"; | |
170 | - | |
171 | - //i3GEO.arvoreDeTemas.TIPOBOTAO = "radio"; | |
172 | - i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios = true; | |
173 | - i3GEO.arvoreDeCamadas.VERIFICAABRANGENCIATEMAS = true; | |
174 | - i3GEO.arvoreDeCamadas.MOSTRALISTAKML = false; | |
175 | - i3GEO.mapa.AUTORESIZE = true; | |
176 | - i3GEO.guias.TIPO = "movel"; | |
177 | - i3GEO.guias.guiaMovel.config.topGuiaMovel = 36; | |
178 | - i3GEO.janela.ativaAlerta(); | |
179 | - i3GEO.finaliza = function() { | |
180 | - if ($i("i3GEOlogoMarca")) { | |
181 | - $i("i3GEOlogoMarca").style.display = "none"; | |
182 | - } | |
183 | - i3GEO.mapa.insereDobraPagina("googlemaps", | |
184 | - "../imagens/dobragooglemaps.png" | |
185 | - ); | |
186 | - }; | |
187 | - i3GEO.finalizaAPI = function() { | |
188 | - <?php echo $_GET["f"].";";?> | |
189 | - }; | |
190 | - //indica se a opcao de navegacao nas pastas do servidor sera ativada | |
191 | - i3GEO.arvoreDeTemas.OPCOESADICIONAIS.navegacaoDir = true; | |
192 | - i3GEO.janela.TRANSICAOSUAVE = true; | |
193 | - i3GEO.mapa.TEMASINICIAIS = "<?php echo $_GET["temasa"];?>" | |
194 | - i3GEO.mapa.TEMASINICIAISLIGADOS = "<?php echo $_GET["layers"];?>" | |
195 | - i3GEO.configura.mashuppar = "&mapext=<?php echo $_GET["mapext"];?>"; | |
196 | - OpenLayers.ImgPath = "../pacotes/openlayers/img/"; | |
197 | - (function() { | |
198 | - var oce = new OpenLayers.Layer.ArcGIS93Rest( | |
199 | - "ESRI Ocean Basemap", | |
200 | - "http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export", | |
201 | - { | |
202 | - format : "jpeg" | |
203 | - }, { | |
204 | - isBaseLayer : true, | |
205 | - visibility : false | |
206 | - }); | |
207 | - var ims = new OpenLayers.Layer.ArcGIS93Rest( | |
208 | - "ESRI Imagery World 2D", | |
209 | - "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export", | |
210 | - { | |
211 | - format : "jpeg" | |
212 | - }, { | |
213 | - isBaseLayer : true, | |
214 | - visibility : false | |
215 | - }); | |
216 | - var wsm = new OpenLayers.Layer.ArcGIS93Rest( | |
217 | - "ESRI World Street Map", | |
218 | - "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export", | |
219 | - { | |
220 | - format : "jpeg" | |
221 | - }, { | |
222 | - isBaseLayer : true, | |
223 | - visibility : false | |
224 | - }); | |
225 | - var bra = new OpenLayers.Layer.WMS( | |
226 | - "Base carto MMA", | |
227 | - "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map", | |
228 | - { | |
229 | - layers : "baseraster", | |
230 | - srs : "EPSG:4618", | |
231 | - format : "image/png", | |
232 | - isBaseLayer : false | |
233 | - }, { | |
234 | - isBaseLayer : true, | |
235 | - visibility : false | |
236 | - }); | |
237 | - | |
238 | - var tms = new OpenLayers.Layer.TMS("OSGEO", | |
239 | - "http://tilecache.osgeo.org/wms-c/Basic.py/", { | |
240 | - layername : "basic", | |
241 | - type : "png", | |
242 | - // set if different than the bottom left of map.maxExtent | |
243 | - tileOrigin : new OpenLayers.LonLat(-180, -90), | |
244 | - isBaseLayer : true, | |
245 | - visibility : false | |
246 | - }); | |
247 | - | |
248 | - i3GEO.Interface.openlayers.LAYERSADICIONAIS = [ oce, ims, wsm, tms, | |
249 | - bra ]; | |
250 | - })(); | |
251 | - i3GEO.configura.sid = ""; | |
252 | - i3GEO.inicia(); | |
253 | - | |
254 | - </script> | |
255 | -</body> | |
256 | -</html> |
ferramentas/upload/upload.php
... | ... | @@ -3,16 +3,18 @@ |
3 | 3 | //caso o usuário seja um administrador, ele pode enviar um nome de diretório onde os arquivos serão armazenados |
4 | 4 | //na variável $dirDestino |
5 | 5 | // |
6 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
6 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
7 | +$_GET = array_merge($_GET,$_POST); | |
8 | +if(isset($_GET["tipo"])){ | |
9 | + $tipo = $_GET["tipo"]; | |
10 | +} | |
7 | 11 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
8 | 12 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
9 | 13 | error_reporting(0); |
10 | 14 | session_name("i3GeoPHP"); |
11 | -if(isset($g_sid) && $g_sid != ""){ | |
12 | - session_id($g_sid); | |
15 | +if(isset($_GET["g_sid"]) && $_GET["g_sid"] != ""){ | |
16 | + session_id($_GET["g_sid"]); | |
13 | 17 | session_start(); |
14 | - //foreach(array_keys($_SESSION) as $k) | |
15 | - //{eval("\$".$k."='".$_SESSION[$k]."';");} | |
16 | 18 | $map_file = $_SESSION["map_file"]; |
17 | 19 | } |
18 | 20 | if (ob_get_level() == 0) ob_start(); |
... | ... | @@ -134,8 +136,8 @@ if (isset($_FILES['i3GEOuploadshp']['name'])) |
134 | 136 | $novolayer->setmetadata("ITENSDESC",$its); |
135 | 137 | $novolayer->set("template","none.htm"); |
136 | 138 | } |
137 | - if(isset($uploadEPSG) && $uploadEPSG != ""){ | |
138 | - $novolayer->setProjection("init=epsg:".$uploadEPSG); | |
139 | + if(isset($_GET["uploadEPSG"]) && $_GET["uploadEPSG"] != ""){ | |
140 | + $novolayer->setProjection("init=epsg:".$_GET["uploadEPSG"]); | |
139 | 141 | } |
140 | 142 | if(file_exists($dirmap."/".$nomePrefixo.".prj")){ |
141 | 143 | $novolayer->setProjection("AUTO"); | ... | ... |
ferramentas/uploaddbf/upload.php
1 | 1 | <?php |
2 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
2 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
3 | +$_GET = array_merge($_GET,$_POST); | |
3 | 4 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
4 | 5 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
5 | 6 | session_name("i3GeoPHP"); |
6 | -if (isset($g_sid)) | |
7 | -{session_id($g_sid);} | |
7 | +if (isset($_GET["g_sid"])) | |
8 | +{session_id($_GET["g_sid"]);} | |
8 | 9 | session_start(); |
9 | -//foreach(array_keys($_SESSION) as $k) | |
10 | -//{eval("\$".$k."='".$_SESSION[$k]."';");} | |
11 | 10 | $map_file = $_SESSION["map_file"]; |
12 | 11 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
13 | 12 | if (ob_get_level() == 0) ob_start(); |
... | ... | @@ -40,9 +39,6 @@ if (isset($_FILES['i3GEOuploaddbffile']['name'])) |
40 | 39 | $ArquivoDest = str_replace(".dbf","",$ArquivoDest).".dbf"; |
41 | 40 | } |
42 | 41 | verificaNome($ArquivoDest); |
43 | - | |
44 | - | |
45 | - | |
46 | 42 | verificaNome($_FILES['i3GEOuploaddbffile']['name']); |
47 | 43 | //sobe arquivo |
48 | 44 | $Arquivo = $_FILES['i3GEOuploaddbffile']['tmp_name']; |
... | ... | @@ -116,6 +112,9 @@ if (isset($_FILES['i3GEOuploaddbffile']['name'])) |
116 | 112 | paraAguarde(); |
117 | 113 | } |
118 | 114 | $shapefileObj = ms_newShapefileObj($nomeshp,-2); |
115 | + $i3GEOuploaddbftipoarquivo = $_GET["i3GEOuploaddbftipoarquivo"]; | |
116 | + $i3GEOuploaddbfnomex = $_GET["i3GEOuploaddbfnomex"]; | |
117 | + $i3GEOuploaddbfnomey = $_GET["i3GEOuploaddbfnomey"]; | |
119 | 118 | |
120 | 119 | if($i3GEOuploaddbftipoarquivo != "dbf"){ |
121 | 120 | foreach($csv->data as $d){ | ... | ... |
ferramentas/uploadgpx/upload.php
1 | 1 | <?php |
2 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
2 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
3 | +$_GET = array_merge($_GET,$_POST); | |
3 | 4 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
4 | 5 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
5 | 6 | error_reporting(0); |
6 | 7 | session_name("i3GeoPHP"); |
7 | -if (isset($g_sid)) | |
8 | -{session_id($g_sid);} | |
8 | +if (isset($_GET["g_sid"])) | |
9 | +{session_id($_GET["g_sid"]);} | |
9 | 10 | session_start(); |
10 | -//foreach(array_keys($_SESSION) as $k) | |
11 | -//{eval("\$".$k."='".$_SESSION[$k]."';");} | |
12 | 11 | $map_file = $_SESSION["map_file"]; |
13 | 12 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
14 | 13 | if (ob_get_level() == 0) ob_start(); |
... | ... | @@ -83,8 +82,8 @@ if (isset($_FILES['i3GEOuploadgpx']['name'])) |
83 | 82 | // le os itens |
84 | 83 | $novolayer->set("status",MS_DEFAULT); |
85 | 84 | $novolayer->set("template","none.htm"); |
86 | - if(isset($uploadgpxEPSG) && $uploadgpxEPSG != "") | |
87 | - {$novolayer->setProjection("init=epsg:".$uploadgpxEPSG);} | |
85 | + if(isset($_GET["uploadkmlEPSG"]) && $_GET["uploadkmlEPSG"] != "") | |
86 | + {$novolayer->setProjection("init=epsg:".$_GET["uploadkmlEPSG"]);} | |
88 | 87 | //$adiciona = ms_newLayerObj($mapa, $novolayer); |
89 | 88 | } |
90 | 89 | $salvo = $mapa->save($map_file); | ... | ... |
ferramentas/uploadkml/upload.php
1 | 1 | <?php |
2 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
2 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
3 | +$_GET = array_merge($_GET,$_POST); | |
3 | 4 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
4 | 5 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
5 | 6 | error_reporting(0); |
6 | 7 | session_name("i3GeoPHP"); |
7 | -if (isset($g_sid)) | |
8 | -{session_id($g_sid);} | |
8 | +if (isset($_GET["g_sid"])) | |
9 | +{session_id($_GET["g_sid"]);} | |
9 | 10 | session_start(); |
10 | 11 | //foreach(array_keys($_SESSION) as $k) |
11 | 12 | //{eval("\$".$k."='".$_SESSION[$k]."';");} |
... | ... | @@ -71,7 +72,7 @@ if (isset($_FILES['i3GEOuploadkml']['name'])) |
71 | 72 | if($tipo == "poligonos") |
72 | 73 | {$novolayer->set("type",MS_LAYER_POLYGON);} |
73 | 74 | $novolayer->set("type",$tipo); |
74 | - $novolayer->set("data",$layerkml); | |
75 | + $novolayer->set("data",$_GET["layerkml"]); | |
75 | 76 | $novolayer->setmetadata("TEMALOCAL","SIM"); |
76 | 77 | $novolayer->setfilter(""); |
77 | 78 | $classe = ms_newClassObj($novolayer); |
... | ... | @@ -87,8 +88,8 @@ if (isset($_FILES['i3GEOuploadkml']['name'])) |
87 | 88 | // le os itens |
88 | 89 | $novolayer->set("status",MS_DEFAULT); |
89 | 90 | $novolayer->set("template","none.htm"); |
90 | - if(isset($uploadkmlEPSG) && $uploadkmlEPSG != "") | |
91 | - {$novolayer->setProjection("init=epsg:".$uploadkmlEPSG);} | |
91 | + if(isset($_GET["uploadkmlEPSG"]) && $_GET["uploadkmlEPSG"] != "") | |
92 | + {$novolayer->setProjection("init=epsg:".$_GET["uploadkmlEPSG"]);} | |
92 | 93 | //$adiciona = ms_newLayerObj($mapa, $novolayer); |
93 | 94 | } |
94 | 95 | $salvo = $mapa->save($map_file); | ... | ... |
ferramentas/uploadsimbolo/upload.php
... | ... | @@ -3,7 +3,6 @@ |
3 | 3 | //caso o usuário seja um administrador, ele pode enviar um nome de diretório onde os arquivos serão armazenados |
4 | 4 | //na variável $dirDestino |
5 | 5 | // |
6 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
7 | 6 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
8 | 7 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
9 | 8 | error_reporting(0); | ... | ... |
fontetema.php
... | ... | @@ -39,11 +39,13 @@ fontetema.php?tema=bioma |
39 | 39 | |
40 | 40 | */ |
41 | 41 | include(dirname(__FILE__)."/ms_configura.php"); |
42 | -include(dirname(__FILE__)."/classesphp/pega_variaveis.php"); | |
43 | 42 | include(dirname(__FILE__)."/admin/php/classe_arvore.php"); |
44 | 43 | |
44 | +include_once (dirname(__FILE__)."/classesphp/sani_request.php"); | |
45 | +$_GET = array_merge($_GET,$_POST); | |
46 | + | |
45 | 47 | $m = new Arvore($locaplic); |
46 | -$retorno = $m->pegaTemaPorCodigo($tema); | |
48 | +$retorno = $m->pegaTemaPorCodigo($_GET["tema"]); | |
47 | 49 | $retorno = $retorno[0]["link_tema"]; |
48 | 50 | if(!headers_sent()) |
49 | 51 | {header("Location:".$retorno);} | ... | ... |
geraminiatura.php
... | ... | @@ -82,13 +82,7 @@ if (!function_exists('ms_GetVersion')) |
82 | 82 | else |
83 | 83 | {dl('php_mapscript.so');} |
84 | 84 | } |
85 | -/* | |
86 | -include($locaplic."/ms_configura.php"); | |
87 | -if(!function_exists("versao")) | |
88 | -{include($locaplic."/classesphp/funcoes_gerais.php");} | |
89 | -require_once($locaplic."/classesphp/pega_variaveis.php"); | |
90 | -include_once ($locaplic."/classesphp/carrega_ext.php"); | |
91 | -*/ | |
85 | + | |
92 | 86 | include_once (dirname(__FILE__)."/admin/php/admin.php"); |
93 | 87 | $versao = versao(); |
94 | 88 | $versao = $versao["principal"]; |
... | ... | @@ -134,7 +128,7 @@ if($tipo == "mini" || $tipo == "todos" || $tipo == "grande" || $tipo == "") |
134 | 128 | { |
135 | 129 | $arq = str_replace(" ","xxxx",$arq); |
136 | 130 | $temp = explode(".",$arq); |
137 | - | |
131 | + | |
138 | 132 | if(file_exists($locaplic.'/temas/'.$arq) && $temp[(count($temp) - 1)] == "map" && !(strpos($temp[0],"_") === 0) ) |
139 | 133 | { |
140 | 134 | echo "<b>$arq</b><br>"; |
... | ... | @@ -253,7 +247,7 @@ function verificaMiniatura($map,$tipo,$admin=false) |
253 | 247 | } |
254 | 248 | } |
255 | 249 | } |
256 | - | |
250 | + | |
257 | 251 | zoomTemaMiniatura($pegarext,$mapa); |
258 | 252 | } |
259 | 253 | if($extensao == ".gvp"){ | ... | ... |
json.php
... | ... | @@ -37,9 +37,9 @@ format - storymap|gdocs |
37 | 37 | No caso de storymap, o fornecimento dos dados depende dos parametros definidos no METADATA storymap existente no tema |
38 | 38 | |
39 | 39 | */ |
40 | +include_once (dirname(__FILE__)."/classesphp/sani_request.php"); | |
40 | 41 | $_GET = array_merge($_GET,$_POST); |
41 | 42 | include(dirname(__FILE__)."/ms_configura.php"); |
42 | -include(dirname(__FILE__)."/classesphp/pega_variaveis.php"); | |
43 | 43 | include(dirname(__FILE__)."/classesphp/funcoes_gerais.php"); |
44 | 44 | // |
45 | 45 | //pega os enderecos para compor a url de chamada do gerador de web services |
... | ... | @@ -50,7 +50,7 @@ $protocolo1 = strtolower($protocolo) . '://'.$_SERVER['SERVER_NAME']; |
50 | 50 | $protocolo = strtolower($protocolo) . '://'.$_SERVER['SERVER_NAME'] .":". $_SERVER['SERVER_PORT']; |
51 | 51 | $urli3geo = str_replace("/ogc.php","",$protocolo.$_SERVER["PHP_SELF"]); |
52 | 52 | |
53 | -$nomeArq = $dir_tmp."/ogc_".md5(implode("",$_GET))."_json_".$output; | |
53 | +$nomeArq = $dir_tmp."/ogc_".md5(implode("",$_GET))."_json_".$_GET["output"]; | |
54 | 54 | $nomeMapfileTmp = $nomeArq.".map"; |
55 | 55 | |
56 | 56 | $cache = carregaCacheArquivo(); |
... | ... | @@ -95,7 +95,7 @@ if(!$testemap){ |
95 | 95 | } |
96 | 96 | |
97 | 97 | copy($base,$nomeMapfileTmp); |
98 | - | |
98 | +$tema = $_GET["tema"]; | |
99 | 99 | $oMap = ms_newMapobj($nomeMapfileTmp); |
100 | 100 | $nmap = ms_newMapobj($locaplic."/temas/".$tema.".map"); |
101 | 101 | $l = $nmap->getlayerbyname($tema); |
... | ... | @@ -121,7 +121,6 @@ if (!empty($postgis_mapa)){ |
121 | 121 | } |
122 | 122 | } |
123 | 123 | } |
124 | - | |
125 | 124 | autoClasses($l,$oMap); |
126 | 125 | ms_newLayerObj($oMap, $l); |
127 | 126 | |
... | ... | @@ -136,6 +135,8 @@ if($layer == ""){ |
136 | 135 | exit; |
137 | 136 | } |
138 | 137 | $data = pegaDadosJ(); |
138 | +$format = $_GET["format"]; | |
139 | +$jsonp = $_GET["jsonp"]; | |
139 | 140 | if($format == "storymap"){ |
140 | 141 | //parametros via URL |
141 | 142 | $storymap = $layer->getmetadata("storymap"); | ... | ... |