Commit 5e02f849b0c5cc047c03621921e501f08628d437
1 parent
6d6ab699
Exists in
master
and in
7 other branches
Correção na árvore de WMS e no registro dos acessos aos WMS
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
admin/php/webservices.php
... | ... | @@ -132,11 +132,13 @@ function adicionaAcesso($id_ws,$sucesso) |
132 | 132 | include("conexao.php"); |
133 | 133 | $dados = pegaDados("select * from i3geoadmin_ws WHERE id_ws = $id_ws"); |
134 | 134 | //var_dump($dados); |
135 | + if($dados[0]["nacessos"] == ""){$dados[0]["nacessos"] = 0;} | |
135 | 136 | $acessos = $dados[0]["nacessos"] + 1; |
136 | 137 | if($sucesso) |
137 | 138 | $ok = $dados[0]["nacessosok"] + 1; |
138 | 139 | else |
139 | 140 | $ok = $dados[0]["nacessosok"]; |
141 | + if($ok == ""){$ok = 0;} | |
140 | 142 | $dbhw->query("UPDATE i3geoadmin_ws SET nacessos = '$acessos',nacessosok = '$ok' WHERE id_ws = $id_ws"); |
141 | 143 | $dbhw = null; |
142 | 144 | $dbh = null; | ... | ... |
classesphp/wmswfs.php
... | ... | @@ -398,6 +398,7 @@ function listaLayersWMS() |
398 | 398 | include_once("../admin/php/admin.php"); |
399 | 399 | include_once("../admin/php/webservices.php"); |
400 | 400 | error_reporting(0); |
401 | + | |
401 | 402 | if($nivel < 2){ |
402 | 403 | if($wms_service_request == "erro") { |
403 | 404 | //registra a tentativa de acesso |
... | ... | @@ -430,12 +431,13 @@ function listaLayersWMS() |
430 | 431 | foreach ($layersanteriores as $layeranterior) |
431 | 432 | { |
432 | 433 | $r1 = pegaTag($layeranterior); |
433 | - if($r1["nome"] == $nomelayer) | |
434 | + if($r1["nome"] == $nomelayer || $r1["titulo"] == $nomelayer) | |
434 | 435 | { |
435 | 436 | $layers = $xpath->query('Layer',$layeranterior); |
436 | 437 | foreach ($layers as $layer) |
437 | 438 | { |
438 | 439 | $r = pegaTag($layer); |
440 | + if(!$r["nome"]){$r["nome"] = $r["titulo"];} | |
439 | 441 | $res[] = array("nome"=>$r["nome"],"titulo"=>$r["titulo"],"estilos"=>$r["estilos"],"srs"=>wms_srs($dom),"formats"=>wms_formats($dom),"version"=>wms_version($dom),"formatsinfo"=>wms_formatsinfo($dom)); |
440 | 442 | } |
441 | 443 | if($layers->length == 0) |
... | ... | @@ -457,6 +459,7 @@ function listaLayersWMS() |
457 | 459 | { |
458 | 460 | $r = pegaTag($layer); |
459 | 461 | //echo $r["nome"]."\n"; |
462 | + if(!$r["nome"]){$r["nome"] = $r["titulo"];} | |
460 | 463 | if(array_search("Style",$r["tags"]) || array_search("Layer",$r["tags"])) |
461 | 464 | {$res[] = array("nome"=>$r["nome"],"titulo"=>$r["titulo"],"estilos"=>$r["estilos"],"srs"=>wms_srs($dom),"formats"=>wms_formats($dom),"version"=>wms_version($dom),"formatsinfo"=>wms_formatsinfo($dom));} |
462 | 465 | } | ... | ... |