Commit 577d8cc479d067c6ac624cc2b0ef18848a8de9d1

Authored by Edmar Moretti
1 parent fd793879

Inclusão da variável no ms_configura.php #62

Showing 2 changed files with 21 additions and 6 deletions   Show diff stats
admin/php/admin.php
@@ -246,18 +246,15 @@ function i3GeoAdminUpdate($pdo,$tabela,$data,$filtro=""){ @@ -246,18 +246,15 @@ function i3GeoAdminUpdate($pdo,$tabela,$data,$filtro=""){
246 function i3GeoAdminInsert($pdo,$tabela,$data){ 246 function i3GeoAdminInsert($pdo,$tabela,$data){
247 global $esquemaadmin; 247 global $esquemaadmin;
248 $keys = array_keys($data); 248 $keys = array_keys($data);
249 - //$fields = "'".implode("','",$keys)."'";  
250 $fields = implode(",",$keys); 249 $fields = implode(",",$keys);
251 $placeholder = str_repeat("?,",count($keys)); 250 $placeholder = str_repeat("?,",count($keys));
252 $placeholder = trim($placeholder,","); 251 $placeholder = trim($placeholder,",");
253 $sql = "INSERT INTO ".$esquemaadmin."$tabela($fields) VALUES ($placeholder)"; 252 $sql = "INSERT INTO ".$esquemaadmin."$tabela($fields) VALUES ($placeholder)";
254 - //echo $sql;  
255 - //var_dump($data);exit;  
256 $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 253 $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
257 try { 254 try {
258 - $prep = $pdo->prepare($sql); 255 + $prep = $pdo->prepare($sql);
259 } catch (PDOException $e) { 256 } catch (PDOException $e) {
260 - return "prepare ".$e->getMessage(); 257 + return "prepare ".$e->getMessage();
261 } 258 }
262 try { 259 try {
263 $exec = $prep->execute(array_values($data)); 260 $exec = $prep->execute(array_values($data));
@@ -307,8 +304,12 @@ function i3GeoAdminInsertUnico($pdo,$tabela,$data,$colTemp,$colId){ @@ -307,8 +304,12 @@ function i3GeoAdminInsertUnico($pdo,$tabela,$data,$colTemp,$colId){
307 return "UPDATE ID ".$e->getMessage(); 304 return "UPDATE ID ".$e->getMessage();
308 } 305 }
309 } 306 }
  307 +//$logTransacoes vem do ms_configura.php
310 function i3GeoAdminInsertLog($pdo,$sql,$data=array()){ 308 function i3GeoAdminInsertLog($pdo,$sql,$data=array()){
311 - global $esquemaadmin; 309 + global $esquemaadmin, $logTransacoes;
  310 + if(isset($logTransacoes) == true && $logTransacoes == false){
  311 + return;
  312 + }
312 $s = "INSERT INTO ".$esquemaadmin."i3geoadmin_log(sql,serializedata,usuario,ip,timestamp,outros) VALUES (?,?,?,?,?,?)"; 313 $s = "INSERT INTO ".$esquemaadmin."i3geoadmin_log(sql,serializedata,usuario,ip,timestamp,outros) VALUES (?,?,?,?,?,?)";
313 $ip = "UNKNOWN"; 314 $ip = "UNKNOWN";
314 if (getenv("HTTP_CLIENT_IP")){ 315 if (getenv("HTTP_CLIENT_IP")){
ms_configura.php
@@ -63,6 +63,20 @@ $i3geomaster = array( @@ -63,6 +63,20 @@ $i3geomaster = array(
63 array("usuario"=>"admin", "senha"=>"admin") 63 array("usuario"=>"admin", "senha"=>"admin")
64 ); 64 );
65 /* 65 /*
  66 + Variable: $logTransacoes
  67 +
  68 +Define se as transacoes no banco de dados de administracao serao mantidas em uma tabela de logs
  69 +
  70 +Tipo:
  71 +{boolean}
  72 +
  73 +Default:
  74 +
  75 +false
  76 +
  77 +*/
  78 +$logTransacoes = false;
  79 +/*
66 Variable: $i3GeoProjDefault 80 Variable: $i3GeoProjDefault
67 81
68 Parametros de projecao cartografica utilizados nos mapas e nas exportacoes de arquivos. 82 Parametros de projecao cartografica utilizados nos mapas e nas exportacoes de arquivos.