Commit 2c3a6d40e3a9434a1bd21299a1869c6304fbd9f3
1 parent
96cb421f
Exists in
master
correção no código
Showing
3 changed files
with
4 additions
and
51 deletions
Show diff stats
classesphp/pega_variaveis.php
... | ... | @@ -60,7 +60,7 @@ if (basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])){ |
60 | 60 | } |
61 | 61 | |
62 | 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 | 64 | if (isset($_GET)) |
65 | 65 | { |
66 | 66 | foreach(array_keys($_GET) as $k) | ... | ... |
classesphp/sani_request.php
... | ... | @@ -3,7 +3,7 @@ if (basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])){ |
3 | 3 | exit; |
4 | 4 | } |
5 | 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 | 7 | if (isset($_GET)){ |
8 | 8 | foreach(array_keys($_GET) as $k) { |
9 | 9 | $k = str_ireplace($bl,"",$k); | ... | ... |
ferramentas/vinde/wmsindejson.php
1 | 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 | 2 | include(dirname(__FILE__)."/../../ms_configura.php"); |
21 | 3 | include($locaplic."/classesphp/funcoes_gerais.php"); |
22 | 4 | $agora = intval(time() / 10000); |
... | ... | @@ -44,19 +26,11 @@ if(!file_exists($arq)){ |
44 | 26 | else{ |
45 | 27 | $resultado = file_get_contents($arq); |
46 | 28 | } |
29 | +$resultado = str_replace("<?","",$resultado); | |
47 | 30 | $convert = explode("\n", $resultado); |
48 | 31 | |
49 | 32 | $n = count($convert); |
50 | 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 | 34 | $busca = array( |
61 | 35 | array("layers","format:"), |
62 | 36 | array("format","transparent:"), |
... | ... | @@ -72,8 +46,6 @@ for ($i=0;$i<$n;$i++){ |
72 | 46 | |
73 | 47 | $pt = "/(new OpenLayers\.Layer\.WMS\(\')(.*)',\s'(.*)',\s{/"; |
74 | 48 | preg_match_all($pt, $linha, $matches); |
75 | - //echo "<pre>"; | |
76 | - //var_dump($matches);exit; | |
77 | 49 | $nomeLayer = $matches[2][0];////converte($matches[2][0]); |
78 | 50 | $layer[] = $nomeLayer; |
79 | 51 | $parametros = array(); |
... | ... | @@ -110,18 +82,11 @@ for ($i=0;$i<$n;$i++){ |
110 | 82 | $layers[$i] = $layer; |
111 | 83 | } |
112 | 84 | } |
113 | - | |
114 | -//separa os grupos | |
115 | -//echo "<pre>"; | |
116 | -//var_dump($grupos);exit; | |
117 | 85 | $chaves = array_keys($grupos); |
118 | 86 | sort($chaves); |
119 | -//echo count($chaves);exit; | |
120 | 87 | $arvore = array(); |
121 | 88 | foreach($chaves as $chave){ |
122 | - //echo $chave."\n"; | |
123 | 89 | $hs = explode("/",$chave); |
124 | - //echo count($hs); | |
125 | 90 | $d = $hs; |
126 | 91 | array_shift($d); |
127 | 92 | if(array_key_exists(0,$hs) && array_key_exists($hs[0],$arvore)){ |
... | ... | @@ -131,8 +96,6 @@ foreach($chaves as $chave){ |
131 | 96 | $arvore[$hs[0]] = noi($d,array()); |
132 | 97 | } |
133 | 98 | } |
134 | -//var_dump($arvore); | |
135 | -//exit; | |
136 | 99 | $final = array( |
137 | 100 | "layers"=>$layers, |
138 | 101 | "arvore"=>$arvore |
... | ... | @@ -147,16 +110,10 @@ echo json_encode($final,true); |
147 | 110 | if(extension_loaded('zlib')){ |
148 | 111 | ob_end_flush(); |
149 | 112 | } |
150 | - | |
151 | -//echo json_encode($novalinha,true); | |
152 | -//echo "{".implode($novalinha,",")."}"; | |
153 | -//echo "[".$novalinha[0]."]"; | |
154 | 113 | function noi($n,$l){ |
155 | 114 | global $layers; |
156 | - //var_dump($n); | |
157 | 115 | $d = $n; |
158 | 116 | array_shift($d); |
159 | - //echo count($n); | |
160 | 117 | if(count($n) > 1){ |
161 | 118 | if(array_key_exists(0,$n) && array_key_exists($n[0],$l)){ |
162 | 119 | if(is_array($n[1])){ |
... | ... | @@ -172,15 +129,11 @@ function noi($n,$l){ |
172 | 129 | $l[$n[0]] = noi($d,$l); |
173 | 130 | return $l; |
174 | 131 | } |
175 | - //$n[1] = $layers[$n[0]]; | |
176 | 132 | return $n; |
177 | 133 | } |
178 | 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 | 137 | return $texto; |
185 | 138 | } |
186 | 139 | ?> | ... | ... |