From 04f16ce234ce8b0db196a1e717f109f437ff0611 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Thu, 29 Nov 2012 17:44:50 +0000 Subject: [PATCH] Inclusão de validação de temas restritos --- testamapfile.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/testamapfile.php b/testamapfile.php index 1f438b1..f20f057 100644 --- a/testamapfile.php +++ b/testamapfile.php @@ -152,12 +152,12 @@ function verifica($map,$solegenda){ if (file_exists('temas/'.$map.'.gvp')) {$tema = 'temas/'.$map.".gvp";} } - if(($tipo == "") || ($tipo == "todos")){ - echo "


Testando: $tema
";
-	}
 	if(!file_exists($tema)){
 		$tema = $locaplic."/".$tema;
 	}
+	if(($tipo == "") || ($tipo == "todos")){
+		echo "


Testando: $tema
";
+	}
 	if(!file_exists($tema)){
 		echo "Arquivo ".$map." não encontrado.";
 		exit;
@@ -234,7 +234,16 @@ function verifica($map,$solegenda){
 			}
 			else{
 				if(@ms_newMapObj($locaplic."/".$tema)){
-					$nmapa = ms_newMapObj($locaplic."/".$tema);
+					if(!function_exists("validaAcessoTemas")){
+						include($locaplic."/classesphp/funcoes_gerais.php");
+					}
+					if(validaAcessoTemas($locaplic."/".$tema,false)  == false){
+						$nmapa = ms_newMapObj($locaplic."/".$tema);
+					}
+					else{
+						echo "tema restrito 
"; + exit; + } } else{ echo "erro no arquivo $map
"; @@ -250,7 +259,7 @@ function verifica($map,$solegenda){ $numlayers = $nmapa->numlayers; $dados = ""; for ($i=0;$i < $numlayers;$i++){ - $layern = $mapa->getlayer($i); + $layern = $nmapa->getlayer($i); $layern->set("status",MS_DEFAULT); if (!empty($postgis_mapa)){ if ($layern->connectiontype == MS_POSTGIS){ -- libgit2 0.21.2