Commit 2c3a6d40e3a9434a1bd21299a1869c6304fbd9f3

Authored by Edmar Moretti
1 parent 96cb421f
Exists in master

correção no código

classesphp/pega_variaveis.php
@@ -60,7 +60,7 @@ if (basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])){ @@ -60,7 +60,7 @@ if (basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])){
60 } 60 }
61 61
62 error_reporting(0); 62 error_reporting(0);
63 -$bl = array("_decode","php","eval","passthru","shell_exec","escapeshellarg","escapeshellcmd","proc_close","proc_open","dl","popen","contents","delete","drop","update","insert","exec","system",";"); 63 +$bl = array("password","select","_decode","php","eval","passthru","shell_exec","escapeshellarg","escapeshellcmd","proc_close","proc_open","dl","popen","contents","delete","drop","update","insert","exec","system",";");
64 if (isset($_GET)) 64 if (isset($_GET))
65 { 65 {
66 foreach(array_keys($_GET) as $k) 66 foreach(array_keys($_GET) as $k)
classesphp/sani_request.php
@@ -3,7 +3,7 @@ if (basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])){ @@ -3,7 +3,7 @@ if (basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])){
3 exit; 3 exit;
4 } 4 }
5 error_reporting(0); 5 error_reporting(0);
6 -$bl = array("_decode","php","eval","passthru","shell_exec","escapeshellarg","escapeshellcmd","proc_close","proc_open","dl","popen","contents","delete","drop","update","insert","exec","system",";"); 6 +$bl = array("password","select","_decode","php","eval","passthru","shell_exec","escapeshellarg","escapeshellcmd","proc_close","proc_open","dl","popen","contents","delete","drop","update","insert","exec","system",";");
7 if (isset($_GET)){ 7 if (isset($_GET)){
8 foreach(array_keys($_GET) as $k) { 8 foreach(array_keys($_GET) as $k) {
9 $k = str_ireplace($bl,"",$k); 9 $k = str_ireplace($bl,"",$k);
ferramentas/vinde/wmsindejson.php
1 <?php 1 <?php
2 -exit;  
3 -/*  
4 -echo  
5 -'[  
6 - "2013 - Agricultura Irrigada",  
7 - "http://www.geoservicos.inde.gov.br/geoserver/wms",  
8 - {  
9 - "layers": "MPOG:Agricultura_Irrigada",  
10 - "format": "image/png",  
11 - "transparent": true  
12 - }  
13 -]  
14 -';  
15 -*/  
16 -/*  
17 - * new OpenLayers.Layer.WMS('2013 - Agricultura Irrigada', 'http://www.geoservicos.inde.gov.br/geoserver/wms', {layers: 'MPOG:Agricultura_Irrigada', format: 'image/png', transparent: true}, {isBaseLayer: false, visibility: false, group: 'Planejamento/Planejamento/2013 - Agricultura Irrigada', metadataURL: 'http://www.metadados.inde.gov.br/geonetwork/srv/br/metadata.show.embedded?uuid=045663f7-5691-447a-8d06-ab692522328c', legendURL: 'http://www.geoservicos.inde.gov.br/geoserver/wms?service=WMS&version=1.1.0&request=GetLegendGraphic&layer=MPOG:Agricultura_Irrigada&format=image/png',kmlURL: 'http://www.geoservicos.inde.gov.br/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=MPOG:Agricultura_Irrigada&width=1024&height=768&bbox=-74,-34,-29,6&format=application/vnd.google-earth.kmz+xml',sldtema: '','maxExtent': new OpenLayers.Bounds(-55.389,-22.229,-37.808,-2.922), isBaseGroup: false, displayInLayerSwitcher: false, removable: false, groupOfKeeper: 'MP/2013 - Agricultura Irrigada', groupOfTheme: 'Planejamento/Planejamento/2013 - Agricultura Irrigada'}),  
18 - */  
19 -  
20 include(dirname(__FILE__)."/../../ms_configura.php"); 2 include(dirname(__FILE__)."/../../ms_configura.php");
21 include($locaplic."/classesphp/funcoes_gerais.php"); 3 include($locaplic."/classesphp/funcoes_gerais.php");
22 $agora = intval(time() / 10000); 4 $agora = intval(time() / 10000);
@@ -44,19 +26,11 @@ if(!file_exists($arq)){ @@ -44,19 +26,11 @@ if(!file_exists($arq)){
44 else{ 26 else{
45 $resultado = file_get_contents($arq); 27 $resultado = file_get_contents($arq);
46 } 28 }
  29 +$resultado = str_replace("<?","",$resultado);
47 $convert = explode("\n", $resultado); 30 $convert = explode("\n", $resultado);
48 31
49 $n = count($convert); 32 $n = count($convert);
50 $layers = array(); 33 $layers = array();
51 -//$novalinha[] = "var servicosINDE = [";  
52 -//$convert= array(" new OpenLayers.Layer.WMS('2013 - Agricultura Irrigada', 'http://www.geoservicos.inde.gov.br/geoserver/wms',  
53 -//{layers: 'MPOG:Agricultura_Irrigada', format: 'image/png', transparent: true},  
54 -//{isBaseLayer: false, visibility: false, group: 'Planejamento/Planejamento/2013 - Agricultura Irrigada',  
55 -//metadataURL: 'http://www.metadados.inde.gov.br/geonetwork/srv/br/metadata.show.embedded?uuid=045663f7-5691-447a-8d06-ab692522328c',  
56 -//legendURL: 'http://www.geoservicos.inde.gov.br/geoserver/wms?service=WMS&version=1.1.0&request=GetLegendGraphic&layer=MPOG:Agricultura_Irrigada&format=image/png',  
57 -//kmlURL: 'http://www.geoservicos.inde.gov.br/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=MPOG:Agricultura_Irrigada&width=1024&height=768&bbox=-74,-34,-29,6&format=application/vnd.google-earth.kmz+xml',sldtema: '',  
58 -//'maxExtent': new OpenLayers.Bounds(-55.389,-22.229,-37.808,-2.922), isBaseGroup: false, displayInLayerSwitcher: false, removable: false, groupOfKeeper: 'MP/2013 - Agricultura Irrigada', groupOfTheme: 'Planejamento/Planejamento/2013 - Agricultura Irrigada'}),  
59 -  
60 $busca = array( 34 $busca = array(
61 array("layers","format:"), 35 array("layers","format:"),
62 array("format","transparent:"), 36 array("format","transparent:"),
@@ -72,8 +46,6 @@ for ($i=0;$i&lt;$n;$i++){ @@ -72,8 +46,6 @@ for ($i=0;$i&lt;$n;$i++){
72 46
73 $pt = "/(new OpenLayers\.Layer\.WMS\(\')(.*)',\s'(.*)',\s{/"; 47 $pt = "/(new OpenLayers\.Layer\.WMS\(\')(.*)',\s'(.*)',\s{/";
74 preg_match_all($pt, $linha, $matches); 48 preg_match_all($pt, $linha, $matches);
75 - //echo "<pre>";  
76 - //var_dump($matches);exit;  
77 $nomeLayer = $matches[2][0];////converte($matches[2][0]); 49 $nomeLayer = $matches[2][0];////converte($matches[2][0]);
78 $layer[] = $nomeLayer; 50 $layer[] = $nomeLayer;
79 $parametros = array(); 51 $parametros = array();
@@ -110,18 +82,11 @@ for ($i=0;$i&lt;$n;$i++){ @@ -110,18 +82,11 @@ for ($i=0;$i&lt;$n;$i++){
110 $layers[$i] = $layer; 82 $layers[$i] = $layer;
111 } 83 }
112 } 84 }
113 -  
114 -//separa os grupos  
115 -//echo "<pre>";  
116 -//var_dump($grupos);exit;  
117 $chaves = array_keys($grupos); 85 $chaves = array_keys($grupos);
118 sort($chaves); 86 sort($chaves);
119 -//echo count($chaves);exit;  
120 $arvore = array(); 87 $arvore = array();
121 foreach($chaves as $chave){ 88 foreach($chaves as $chave){
122 - //echo $chave."\n";  
123 $hs = explode("/",$chave); 89 $hs = explode("/",$chave);
124 - //echo count($hs);  
125 $d = $hs; 90 $d = $hs;
126 array_shift($d); 91 array_shift($d);
127 if(array_key_exists(0,$hs) && array_key_exists($hs[0],$arvore)){ 92 if(array_key_exists(0,$hs) && array_key_exists($hs[0],$arvore)){
@@ -131,8 +96,6 @@ foreach($chaves as $chave){ @@ -131,8 +96,6 @@ foreach($chaves as $chave){
131 $arvore[$hs[0]] = noi($d,array()); 96 $arvore[$hs[0]] = noi($d,array());
132 } 97 }
133 } 98 }
134 -//var_dump($arvore);  
135 -//exit;  
136 $final = array( 99 $final = array(
137 "layers"=>$layers, 100 "layers"=>$layers,
138 "arvore"=>$arvore 101 "arvore"=>$arvore
@@ -147,16 +110,10 @@ echo json_encode($final,true); @@ -147,16 +110,10 @@ echo json_encode($final,true);
147 if(extension_loaded('zlib')){ 110 if(extension_loaded('zlib')){
148 ob_end_flush(); 111 ob_end_flush();
149 } 112 }
150 -  
151 -//echo json_encode($novalinha,true);  
152 -//echo "{".implode($novalinha,",")."}";  
153 -//echo "[".$novalinha[0]."]";  
154 function noi($n,$l){ 113 function noi($n,$l){
155 global $layers; 114 global $layers;
156 - //var_dump($n);  
157 $d = $n; 115 $d = $n;
158 array_shift($d); 116 array_shift($d);
159 - //echo count($n);  
160 if(count($n) > 1){ 117 if(count($n) > 1){
161 if(array_key_exists(0,$n) && array_key_exists($n[0],$l)){ 118 if(array_key_exists(0,$n) && array_key_exists($n[0],$l)){
162 if(is_array($n[1])){ 119 if(is_array($n[1])){
@@ -172,15 +129,11 @@ function noi($n,$l){ @@ -172,15 +129,11 @@ function noi($n,$l){
172 $l[$n[0]] = noi($d,$l); 129 $l[$n[0]] = noi($d,$l);
173 return $l; 130 return $l;
174 } 131 }
175 - //$n[1] = $layers[$n[0]];  
176 return $n; 132 return $n;
177 } 133 }
178 function converte($texto) 134 function converte($texto)
179 { 135 {
180 - //if (!mb_detect_encoding($texto,"UTF-8",false))  
181 - //{  
182 - $texto = mb_convert_encoding($texto,"ISO-8859-1","AUTO");  
183 - //} 136 + $texto = mb_convert_encoding($texto,"ISO-8859-1","AUTO");
184 return $texto; 137 return $texto;
185 } 138 }
186 ?> 139 ?>