diff --git a/admin/admin.db b/admin/admin.db index 2830e1d..7b8fd93 100755 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php index 8e156f5..59d669b 100755 --- a/classesphp/funcoes_gerais.php +++ b/classesphp/funcoes_gerais.php @@ -3044,9 +3044,9 @@ 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. + $log = "Ip: ".$_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); + file_put_contents($dir_tmp.'/.log_i3geo_'.date("j.n.Y"), $log, FILE_APPEND); } ?> diff --git a/classesphp/mapa_googlemaps.php b/classesphp/mapa_googlemaps.php index ce817ea..24d9ab8 100755 --- a/classesphp/mapa_googlemaps.php +++ b/classesphp/mapa_googlemaps.php @@ -146,7 +146,10 @@ elseif(isset($_GET["BBOX"])){ //por seguranca include_once("funcoes_gerais.php"); -i3GeoLog("mapa_googlemaps",$_SESSION["dir_tmp"]); +$logExec = $_SESSION["logExec"]; +if(isset($logExec) && $logExec["mapa_"] == true){ + i3GeoLog("mapa_googlemaps ".implode("&",array_merge($_GET,$_POST)),$_SESSION["dir_tmp"]); +} restauraCon($map_fileX,$postgis_mapa); diff --git a/classesphp/mapa_inicia.php b/classesphp/mapa_inicia.php index cf48ee8..b1d739a 100755 --- a/classesphp/mapa_inicia.php +++ b/classesphp/mapa_inicia.php @@ -102,7 +102,7 @@ Retorno: */ function iniciaMapa() { - global $postgis_mapa,$statusFerramentas,$saikuUrl,$emailInstituicao,$openid,$interfacePadrao,$mensagemInicia,$kmlurl,$tituloInstituicao,$tempo,$navegadoresLocais,$locaplic,$embedLegenda,$map_file,$mapext,$w,$h,$R_path,$locmapserv,$utilizacgi,$expoeMapfile,$interface; + global $dir_tmp, $logExec, $postgis_mapa,$statusFerramentas,$saikuUrl,$emailInstituicao,$openid,$interfacePadrao,$mensagemInicia,$kmlurl,$tituloInstituicao,$tempo,$navegadoresLocais,$locaplic,$embedLegenda,$map_file,$mapext,$w,$h,$R_path,$locmapserv,$utilizacgi,$expoeMapfile,$interface; // //verifica se algum tema e restrito a determinado usuario //as funcoes de validacao encontram-se em funcoes_gerais.php @@ -111,6 +111,11 @@ function iniciaMapa() include_once("funcoes_gerais.php"); } validaAcessoTemas($map_file); + + if($dir_tmp != "" && isset($logExec) && $logExec["init"] == true){ + i3GeoLog("iniciaMapa $interface",$dir_tmp); + } + if(!isset($kmlurl)){ $kmlurl = ""; } diff --git a/classesphp/mapa_openlayers.php b/classesphp/mapa_openlayers.php index a245020..eaa6d0d 100755 --- a/classesphp/mapa_openlayers.php +++ b/classesphp/mapa_openlayers.php @@ -166,7 +166,10 @@ $postgis_mapa = $_SESSION["postgis_mapa"]; //por seguranca include_once("funcoes_gerais.php"); -i3GeoLog("mapa_openlayers",$_SESSION["dir_tmp"]); +$logExec = $_SESSION["logExec"]; +if(isset($logExec) && $logExec["mapa_"] == true){ + i3GeoLog("mapa_openlayers ".implode("&",array_merge($_GET,$_POST)),$_SESSION["dir_tmp"]); +} restauraCon($map_fileX,$postgis_mapa); diff --git a/ms_configura.php b/ms_configura.php index c56591d..36deab5 100755 --- a/ms_configura.php +++ b/ms_configura.php @@ -86,6 +86,12 @@ false */ $logTransacoes = false; +//TODO documentar +$logExec = array( + "mapa_" => true, //mapa_openlayers e mapa_googlemaps + "init" => true, //ms_criamapa mapa_inicia + "ogc" => true +); /* Variable: $i3GeoProjDefault diff --git a/ms_criamapa.php b/ms_criamapa.php index 83c76a3..81611fe 100755 --- a/ms_criamapa.php +++ b/ms_criamapa.php @@ -286,7 +286,9 @@ $versao = $versao["principal"]; if(!isset($dir_tmp)){ include_once (dirname(__FILE__)."/ms_configura.php"); } -i3GeoLog("ms_criamapa",$dir_tmp); +if(isset($logExec) && $logExec["init"] == true){ + i3GeoLog("ms_criamapa ".implode("&",array_merge($_GET,$_POST)),$_SESSION["dir_tmp"]); +} if(!empty($restauramapa)){ $base = restauraMapaAdmin($restauramapa,$dir_tmp); $m = ms_newMapObj($base); @@ -604,6 +606,7 @@ $_SESSION["imgurl"] = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].$atu $_SESSION["tmpurl"] = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].$atual; $_SESSION["map_file"] = $tmpfname; $_SESSION["mapext"] = $mapext; +$_SESSION["logExec"] = $logExec; if (isset($executa)){ if (file_exists($executa)){ //include_once ($executa); diff --git a/ogc.php b/ogc.php index da406d1..2c009f5 100755 --- a/ogc.php +++ b/ogc.php @@ -130,7 +130,9 @@ $cache = true; include(dirname(__FILE__)."/ms_configura.php"); include(dirname(__FILE__)."/classesphp/funcoes_gerais.php"); -i3GeoLog("ogc ".implode("&",$_GET),$_SESSION["dir_tmp"]); +if(isset($logExec) && $logExec["ogc"] == true){ + i3GeoLog("ogc ".implode("&",$_GET),$_SESSION["dir_tmp"]); +} // //ajusta o default // -- libgit2 0.21.2