Commit 624f9b3454646d15f03eb8668da3484167a48917

Authored by Edmar Moretti
1 parent b06bcef9

funcao de log

admin/admin.db
No preview for this file type
admin/php/editormapfile.php
@@ -40,6 +40,14 @@ Cada operação possuí seus proprios parâmetros, que de @@ -40,6 +40,14 @@ Cada operação possuí seus proprios parâmetros, que de
40 40
41 */ 41 */
42 include_once(dirname(__FILE__)."/login.php"); 42 include_once(dirname(__FILE__)."/login.php");
  43 +
  44 +$id = $_GET["id"];
  45 +
  46 +testaSafeNumerico([$id]);
  47 +
  48 +$codigoMap = $_GET["codigoMap"];
  49 +$codigoLayer = $_GET["codigoLayer"];
  50 +
43 $funcoesEdicao = array( 51 $funcoesEdicao = array(
44 "CRIARNOVOMAP", 52 "CRIARNOVOMAP",
45 "EDITASIMBOLO", 53 "EDITASIMBOLO",
@@ -68,7 +76,8 @@ $funcoesEdicao = array( @@ -68,7 +76,8 @@ $funcoesEdicao = array(
68 "ALTERAREDITAVEL", 76 "ALTERAREDITAVEL",
69 "PEGAPLUGIN", 77 "PEGAPLUGIN",
70 "GRAVAPLUGIN", 78 "GRAVAPLUGIN",
71 - "REMOVEPLUGIN" 79 + "REMOVEPLUGIN",
  80 + "DOWNLOADGVP"
72 ); 81 );
73 if(in_array(strtoupper($funcao),$funcoesEdicao)){ 82 if(in_array(strtoupper($funcao),$funcoesEdicao)){
74 if(verificaOperacaoSessao("admin/html/editormapfile") == false){ 83 if(verificaOperacaoSessao("admin/html/editormapfile") == false){
@@ -91,8 +100,10 @@ error_reporting(0); @@ -91,8 +100,10 @@ error_reporting(0);
91 //algumas funcoes podem ser inseridas com include em outros programas 100 //algumas funcoes podem ser inseridas com include em outros programas
92 //nesse caso, defina output como "retorno" 101 //nesse caso, defina output como "retorno"
93 //caso contrario sera definido como json 102 //caso contrario sera definido como json
94 -if(empty($output)){ 103 +if(empty($_GET["output"])){
95 $output = "json"; 104 $output = "json";
  105 +} else {
  106 + $output = $_GET["output"];
96 } 107 }
97 //faz a busca da função que deve ser executada 108 //faz a busca da função que deve ser executada
98 switch (strtoupper($funcao)) 109 switch (strtoupper($funcao))
@@ -142,7 +153,7 @@ switch (strtoupper($funcao)) @@ -142,7 +153,7 @@ switch (strtoupper($funcao))
142 $mapfile = $locaplic."/temas/".$codigoMap.".map"; 153 $mapfile = $locaplic."/temas/".$codigoMap.".map";
143 $mapa = ms_newMapObj($mapfile); 154 $mapa = ms_newMapObj($mapfile);
144 $layer = $mapa->getlayerbyname($codigoLayer); 155 $layer = $mapa->getlayerbyname($codigoLayer);
145 - $layer->setmetadata("PLUGINI3GEO",$plugin); 156 + $layer->setmetadata("PLUGINI3GEO",$_GET["plugin"]);
146 $mapa->save($mapfile); 157 $mapa->save($mapfile);
147 removeCabecalho($mapfile); 158 removeCabecalho($mapfile);
148 retornaJSON("ok"); 159 retornaJSON("ok");
@@ -216,8 +227,9 @@ switch (strtoupper($funcao)) @@ -216,8 +227,9 @@ switch (strtoupper($funcao))
216 $base = $locaplic."/aplicmap/".$base; 227 $base = $locaplic."/aplicmap/".$base;
217 } 228 }
218 } 229 }
  230 + $base = str_replace(".map","",$base).".map";
219 $m = new Legenda($base,$locaplic); 231 $m = new Legenda($base,$locaplic);
220 - retornaJSON($m->listaSimbolos($tipo,$dir_tmp,"",$onclick,8,1,true)); 232 + retornaJSON($m->listaSimbolos($tipo,$dir_tmp,"",$_GET["onclick"],8,1,true));
221 exit; 233 exit;
222 break; 234 break;
223 /* 235 /*
@@ -1130,10 +1142,10 @@ switch (strtoupper($funcao)) @@ -1130,10 +1142,10 @@ switch (strtoupper($funcao))
1130 } 1142 }
1131 function clonarMapfile() 1143 function clonarMapfile()
1132 { 1144 {
1133 - global $novomap, $codigomap, $locaplic; 1145 + global $codigomap, $locaplic;
1134 error_reporting(0); 1146 error_reporting(0);
1135 $arqtema = $locaplic."/temas/".$codigomap.".map"; 1147 $arqtema = $locaplic."/temas/".$codigomap.".map";
1136 - $novotema = $locaplic."/temas/".$novomap.".map"; 1148 + $novotema = $locaplic."/temas/".$_GET["novomap"].".map";
1137 copy($arqtema,$novotema); 1149 copy($arqtema,$novotema);
1138 $mapa = ms_newMapObj($novotema); 1150 $mapa = ms_newMapObj($novotema);
1139 $layer = @$mapa->getlayerbyname($codigomap); 1151 $layer = @$mapa->getlayerbyname($codigomap);
@@ -1144,7 +1156,11 @@ function clonarMapfile() @@ -1144,7 +1156,11 @@ function clonarMapfile()
1144 } 1156 }
1145 function refazerLayer() 1157 function refazerLayer()
1146 { 1158 {
1147 - global $nomelayer, $codigomap, $maporigem, $locaplic, $cache; 1159 + global $nomelayer, $codigomap, $locaplic;
  1160 +
  1161 + $maporigem = $_GET["maporigem"];
  1162 + $cache = $_GET["cache"];
  1163 +
1148 error_reporting(0); 1164 error_reporting(0);
1149 if(empty($cache)){ 1165 if(empty($cache)){
1150 $cache = ""; 1166 $cache = "";
classesphp/funcoes_gerais.php
@@ -3040,4 +3040,13 @@ function fileContemString($arq,$s){ @@ -3040,4 +3040,13 @@ function fileContemString($arq,$s){
3040 fclose($handle); 3040 fclose($handle);
3041 return $valid; 3041 return $valid;
3042 } 3042 }
  3043 +function i3GeoLog($txt,$dir_tmp=""){
  3044 + if(empty($dir_tmp)){
  3045 + include(dirname(__FILE__)."/../ms_configura.php");
  3046 + }
  3047 + $log = "User: ".$_SERVER['REMOTE_ADDR'].' - '.date("F j, Y, g:i a").PHP_EOL.
  3048 + $txt.PHP_EOL.
  3049 + "-------------------------".PHP_EOL;
  3050 + file_put_contents($dir_tmp.'/log_i3geo_'.date("j.n.Y").'.txt', $log, FILE_APPEND);
  3051 +}
3043 ?> 3052 ?>
classesphp/mapa_googlemaps.php
@@ -145,6 +145,9 @@ elseif(isset($_GET["BBOX"])){ @@ -145,6 +145,9 @@ elseif(isset($_GET["BBOX"])){
145 } 145 }
146 //por seguranca 146 //por seguranca
147 include_once("funcoes_gerais.php"); 147 include_once("funcoes_gerais.php");
  148 +
  149 +i3GeoLog("mapa_googlemaps",$_SESSION["dir_tmp"]);
  150 +
148 restauraCon($map_fileX,$postgis_mapa); 151 restauraCon($map_fileX,$postgis_mapa);
149 152
150 $mapa = ms_newMapObj($map_fileX); 153 $mapa = ms_newMapObj($map_fileX);
classesphp/mapa_openlayers.php
@@ -165,6 +165,9 @@ $postgis_mapa = $_SESSION["postgis_mapa"]; @@ -165,6 +165,9 @@ $postgis_mapa = $_SESSION["postgis_mapa"];
165 165
166 //por seguranca 166 //por seguranca
167 include_once("funcoes_gerais.php"); 167 include_once("funcoes_gerais.php");
  168 +
  169 +i3GeoLog("mapa_openlayers",$_SESSION["dir_tmp"]);
  170 +
168 restauraCon($map_fileX,$postgis_mapa); 171 restauraCon($map_fileX,$postgis_mapa);
169 172
170 $cachedir = $_SESSION["cachedir"]; 173 $cachedir = $_SESSION["cachedir"];
ms_criamapa.php
@@ -223,6 +223,7 @@ filtros - filtros podem ser adicionados incluindo o parametro da seguinte forma: @@ -223,6 +223,7 @@ filtros - filtros podem ser adicionados incluindo o parametro da seguinte forma:
223 // 223 //
224 //quando $funcao existe, é pq o ms_criamapa.php está sendo utilizado como um include em classesphp/mapa_controle.php 224 //quando $funcao existe, é pq o ms_criamapa.php está sendo utilizado como um include em classesphp/mapa_controle.php
225 // 225 //
  226 +
226 ms_ResetErrorList(); 227 ms_ResetErrorList();
227 if(!isset($funcao)){ 228 if(!isset($funcao)){
228 ob_end_clean(); 229 ob_end_clean();
@@ -285,6 +286,7 @@ $versao = $versao["principal"]; @@ -285,6 +286,7 @@ $versao = $versao["principal"];
285 if(!isset($dir_tmp)){ 286 if(!isset($dir_tmp)){
286 include_once (dirname(__FILE__)."/ms_configura.php"); 287 include_once (dirname(__FILE__)."/ms_configura.php");
287 } 288 }
  289 +i3GeoLog("ms_criamapa",$dir_tmp);
288 if(!empty($restauramapa)){ 290 if(!empty($restauramapa)){
289 $base = restauraMapaAdmin($restauramapa,$dir_tmp); 291 $base = restauraMapaAdmin($restauramapa,$dir_tmp);
290 $m = ms_newMapObj($base); 292 $m = ms_newMapObj($base);
@@ -130,6 +130,7 @@ $cache = true; @@ -130,6 +130,7 @@ $cache = true;
130 include(dirname(__FILE__)."/ms_configura.php"); 130 include(dirname(__FILE__)."/ms_configura.php");
131 include(dirname(__FILE__)."/classesphp/funcoes_gerais.php"); 131 include(dirname(__FILE__)."/classesphp/funcoes_gerais.php");
132 132
  133 +i3GeoLog("ogc ".implode("&",$_GET),$_SESSION["dir_tmp"]);
133 // 134 //
134 //ajusta o default 135 //ajusta o default
135 // 136 //