From 624f9b3454646d15f03eb8668da3484167a48917 Mon Sep 17 00:00:00 2001 From: edmarmoretti Date: Thu, 11 Aug 2016 17:00:13 -0300 Subject: [PATCH] funcao de log --- admin/admin.db | Bin 340992 -> 0 bytes admin/php/editormapfile.php | 30 +++++++++++++++++++++++------- classesphp/funcoes_gerais.php | 9 +++++++++ classesphp/mapa_googlemaps.php | 3 +++ classesphp/mapa_openlayers.php | 3 +++ ms_criamapa.php | 2 ++ ogc.php | 1 + 7 files changed, 41 insertions(+), 7 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index 7df03db..2830e1d 100755 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/admin/php/editormapfile.php b/admin/php/editormapfile.php index b930e54..a11e52b 100755 --- a/admin/php/editormapfile.php +++ b/admin/php/editormapfile.php @@ -40,6 +40,14 @@ Cada operação possuí seus proprios parâmetros, que de */ include_once(dirname(__FILE__)."/login.php"); + +$id = $_GET["id"]; + +testaSafeNumerico([$id]); + +$codigoMap = $_GET["codigoMap"]; +$codigoLayer = $_GET["codigoLayer"]; + $funcoesEdicao = array( "CRIARNOVOMAP", "EDITASIMBOLO", @@ -68,7 +76,8 @@ $funcoesEdicao = array( "ALTERAREDITAVEL", "PEGAPLUGIN", "GRAVAPLUGIN", - "REMOVEPLUGIN" + "REMOVEPLUGIN", + "DOWNLOADGVP" ); if(in_array(strtoupper($funcao),$funcoesEdicao)){ if(verificaOperacaoSessao("admin/html/editormapfile") == false){ @@ -91,8 +100,10 @@ error_reporting(0); //algumas funcoes podem ser inseridas com include em outros programas //nesse caso, defina output como "retorno" //caso contrario sera definido como json -if(empty($output)){ +if(empty($_GET["output"])){ $output = "json"; +} else { + $output = $_GET["output"]; } //faz a busca da função que deve ser executada switch (strtoupper($funcao)) @@ -142,7 +153,7 @@ switch (strtoupper($funcao)) $mapfile = $locaplic."/temas/".$codigoMap.".map"; $mapa = ms_newMapObj($mapfile); $layer = $mapa->getlayerbyname($codigoLayer); - $layer->setmetadata("PLUGINI3GEO",$plugin); + $layer->setmetadata("PLUGINI3GEO",$_GET["plugin"]); $mapa->save($mapfile); removeCabecalho($mapfile); retornaJSON("ok"); @@ -216,8 +227,9 @@ switch (strtoupper($funcao)) $base = $locaplic."/aplicmap/".$base; } } + $base = str_replace(".map","",$base).".map"; $m = new Legenda($base,$locaplic); - retornaJSON($m->listaSimbolos($tipo,$dir_tmp,"",$onclick,8,1,true)); + retornaJSON($m->listaSimbolos($tipo,$dir_tmp,"",$_GET["onclick"],8,1,true)); exit; break; /* @@ -1130,10 +1142,10 @@ switch (strtoupper($funcao)) } function clonarMapfile() { - global $novomap, $codigomap, $locaplic; + global $codigomap, $locaplic; error_reporting(0); $arqtema = $locaplic."/temas/".$codigomap.".map"; - $novotema = $locaplic."/temas/".$novomap.".map"; + $novotema = $locaplic."/temas/".$_GET["novomap"].".map"; copy($arqtema,$novotema); $mapa = ms_newMapObj($novotema); $layer = @$mapa->getlayerbyname($codigomap); @@ -1144,7 +1156,11 @@ function clonarMapfile() } function refazerLayer() { - global $nomelayer, $codigomap, $maporigem, $locaplic, $cache; + global $nomelayer, $codigomap, $locaplic; + + $maporigem = $_GET["maporigem"]; + $cache = $_GET["cache"]; + error_reporting(0); if(empty($cache)){ $cache = ""; diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php index 26d5576..8e156f5 100755 --- a/classesphp/funcoes_gerais.php +++ b/classesphp/funcoes_gerais.php @@ -3040,4 +3040,13 @@ function fileContemString($arq,$s){ fclose($handle); return $valid; } +function i3GeoLog($txt,$dir_tmp=""){ + if(empty($dir_tmp)){ + include(dirname(__FILE__)."/../ms_configura.php"); + } + $log = "User: ".$_SERVER['REMOTE_ADDR'].' - '.date("F j, Y, g:i a").PHP_EOL. + $txt.PHP_EOL. + "-------------------------".PHP_EOL; + file_put_contents($dir_tmp.'/log_i3geo_'.date("j.n.Y").'.txt', $log, FILE_APPEND); +} ?> diff --git a/classesphp/mapa_googlemaps.php b/classesphp/mapa_googlemaps.php index 50c05dc..ce817ea 100755 --- a/classesphp/mapa_googlemaps.php +++ b/classesphp/mapa_googlemaps.php @@ -145,6 +145,9 @@ elseif(isset($_GET["BBOX"])){ } //por seguranca include_once("funcoes_gerais.php"); + +i3GeoLog("mapa_googlemaps",$_SESSION["dir_tmp"]); + restauraCon($map_fileX,$postgis_mapa); $mapa = ms_newMapObj($map_fileX); diff --git a/classesphp/mapa_openlayers.php b/classesphp/mapa_openlayers.php index d13961f..a245020 100755 --- a/classesphp/mapa_openlayers.php +++ b/classesphp/mapa_openlayers.php @@ -165,6 +165,9 @@ $postgis_mapa = $_SESSION["postgis_mapa"]; //por seguranca include_once("funcoes_gerais.php"); + +i3GeoLog("mapa_openlayers",$_SESSION["dir_tmp"]); + restauraCon($map_fileX,$postgis_mapa); $cachedir = $_SESSION["cachedir"]; diff --git a/ms_criamapa.php b/ms_criamapa.php index 7741848..83c76a3 100755 --- a/ms_criamapa.php +++ b/ms_criamapa.php @@ -223,6 +223,7 @@ filtros - filtros podem ser adicionados incluindo o parametro da seguinte forma: // //quando $funcao existe, é pq o ms_criamapa.php está sendo utilizado como um include em classesphp/mapa_controle.php // + ms_ResetErrorList(); if(!isset($funcao)){ ob_end_clean(); @@ -285,6 +286,7 @@ $versao = $versao["principal"]; if(!isset($dir_tmp)){ include_once (dirname(__FILE__)."/ms_configura.php"); } +i3GeoLog("ms_criamapa",$dir_tmp); if(!empty($restauramapa)){ $base = restauraMapaAdmin($restauramapa,$dir_tmp); $m = ms_newMapObj($base); diff --git a/ogc.php b/ogc.php index 7b5cdc8..da406d1 100755 --- a/ogc.php +++ b/ogc.php @@ -130,6 +130,7 @@ $cache = true; include(dirname(__FILE__)."/ms_configura.php"); include(dirname(__FILE__)."/classesphp/funcoes_gerais.php"); +i3GeoLog("ogc ".implode("&",$_GET),$_SESSION["dir_tmp"]); // //ajusta o default // -- libgit2 0.21.2