Commit 04f16ce234ce8b0db196a1e717f109f437ff0611
1 parent
62e6020e
Exists in
master
and in
7 other branches
Inclusão de validação de temas restritos
Showing
1 changed file
with
14 additions
and
5 deletions
Show diff stats
testamapfile.php
| ... | ... | @@ -152,12 +152,12 @@ function verifica($map,$solegenda){ |
| 152 | 152 | if (file_exists('temas/'.$map.'.gvp')) |
| 153 | 153 | {$tema = 'temas/'.$map.".gvp";} |
| 154 | 154 | } |
| 155 | - if(($tipo == "") || ($tipo == "todos")){ | |
| 156 | - echo "<hr><br><br><span style='color:red' ><b>Testando: $tema </span><pre></b>"; | |
| 157 | - } | |
| 158 | 155 | if(!file_exists($tema)){ |
| 159 | 156 | $tema = $locaplic."/".$tema; |
| 160 | 157 | } |
| 158 | + if(($tipo == "") || ($tipo == "todos")){ | |
| 159 | + echo "<hr><br><br><span style='color:red' ><b>Testando: $tema </span><pre></b>"; | |
| 160 | + } | |
| 161 | 161 | if(!file_exists($tema)){ |
| 162 | 162 | echo "Arquivo ".$map." não encontrado."; |
| 163 | 163 | exit; |
| ... | ... | @@ -234,7 +234,16 @@ function verifica($map,$solegenda){ |
| 234 | 234 | } |
| 235 | 235 | else{ |
| 236 | 236 | if(@ms_newMapObj($locaplic."/".$tema)){ |
| 237 | - $nmapa = ms_newMapObj($locaplic."/".$tema); | |
| 237 | + if(!function_exists("validaAcessoTemas")){ | |
| 238 | + include($locaplic."/classesphp/funcoes_gerais.php"); | |
| 239 | + } | |
| 240 | + if(validaAcessoTemas($locaplic."/".$tema,false) == false){ | |
| 241 | + $nmapa = ms_newMapObj($locaplic."/".$tema); | |
| 242 | + } | |
| 243 | + else{ | |
| 244 | + echo "tema restrito <br>"; | |
| 245 | + exit; | |
| 246 | + } | |
| 238 | 247 | } |
| 239 | 248 | else{ |
| 240 | 249 | echo "erro no arquivo $map <br>"; |
| ... | ... | @@ -250,7 +259,7 @@ function verifica($map,$solegenda){ |
| 250 | 259 | $numlayers = $nmapa->numlayers; |
| 251 | 260 | $dados = ""; |
| 252 | 261 | for ($i=0;$i < $numlayers;$i++){ |
| 253 | - $layern = $mapa->getlayer($i); | |
| 262 | + $layern = $nmapa->getlayer($i); | |
| 254 | 263 | $layern->set("status",MS_DEFAULT); |
| 255 | 264 | if (!empty($postgis_mapa)){ |
| 256 | 265 | if ($layern->connectiontype == MS_POSTGIS){ | ... | ... |