Commit a11622f765ada7bf166e5c261bd91bd358c129dd
1 parent
78c84266
Exists in
master
and in
7 other branches
Otimização da verificação de layers restritos em ogc.php
Showing
3 changed files
with
15 additions
and
20 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/funcoes_gerais.php
... | ... | @@ -2725,7 +2725,13 @@ function validaAcessoTemas($map_file,$salva = true){ |
2725 | 2725 | $existeIndevidos = false; |
2726 | 2726 | if(count($indevidos) > 0){ |
2727 | 2727 | $existeIndevidos = true; |
2728 | - $m = ms_newMapObj($map_file); | |
2728 | + if(!is_object($map_file)){ | |
2729 | + $m = ms_newMapObj($map_file); | |
2730 | + } | |
2731 | + else { | |
2732 | + $m = $map_file; | |
2733 | + $salva = false; | |
2734 | + } | |
2729 | 2735 | foreach($indevidos as $i){ |
2730 | 2736 | $l = $m->getlayerbyname($i); |
2731 | 2737 | $l->set("status",MS_DELETE); |
... | ... | @@ -2769,24 +2775,14 @@ function listaLayersIndevidos($map_file){ |
2769 | 2775 | error_reporting(0); |
2770 | 2776 | $indevidos = array(); |
2771 | 2777 | $restritos = listaTemasRestritos(); |
2772 | - /* | |
2773 | - array(1) { | |
2774 | - ["_wlocalirestrito"]=> | |
2775 | - array(1) { | |
2776 | - [0]=> | |
2777 | - string(1) "1" | |
2778 | - } | |
2779 | - } | |
2780 | - */ | |
2781 | 2778 | if(count($restritos) > 0){ |
2782 | 2779 | $gruposusr = listaGruposUsrLogin(); |
2783 | - /* | |
2784 | - array(1) { | |
2785 | - [0]=> | |
2786 | - string(1) "1" | |
2780 | + if(!is_object($map_file)){ | |
2781 | + $m = ms_newMapObj($map_file); | |
2782 | + } | |
2783 | + else { | |
2784 | + $m = $map_file; | |
2787 | 2785 | } |
2788 | - */ | |
2789 | - $m = ms_newMapObj($map_file); | |
2790 | 2786 | $c = $m->numlayers; |
2791 | 2787 | for ($i=0;$i < $c;++$i) { |
2792 | 2788 | $layer = $m->getlayer($i); | ... | ... |
ogc.php
... | ... | @@ -785,12 +785,11 @@ else{ |
785 | 785 | // |
786 | 786 | processaOutputformatMapfile(); |
787 | 787 | $nomeMapfileTmp = str_replace(".map","",$nomeMapfileTmp).".map"; |
788 | + restauraConObj($oMap,$postgis_mapa); | |
788 | 789 | $oMap->save($nomeMapfileTmp); |
789 | - validaAcessoTemas($nomeMapfileTmp,true); | |
790 | 790 | |
791 | - substituiCon($nomeMapfileTmp,$postgis_mapa); | |
792 | - $oMap = ms_newMapobj($nomeMapfileTmp); | |
793 | - restauraCon($nomeMapfileTmp,$postgis_mapa); | |
791 | + validaAcessoTemas($oMap,true); | |
792 | + substituiConObj($oMap,$postgis_mapa); | |
794 | 793 | } |
795 | 794 | |
796 | 795 | if(ob_get_contents ()){ | ... | ... |