Commit 8c98db4c5358301efe2c9031fd13505b5b603306

Authored by Edmar Moretti
1 parent ee1b8ed5

Conclusão da implantação do log de transações #62

admin/php/arvore.php
... ... @@ -530,7 +530,7 @@ switch (strtoupper($funcao))
530 530 }
531 531 }
532 532 retornaJSON(
533   - exclui($tabela,$coluna,$id)
  533 + exclui($esquemaadmin.$tabela,$coluna,$id)
534 534 );
535 535 exit;
536 536 break;
... ...
admin/php/conexaopostgresql.php
... ... @@ -3,8 +3,8 @@
3 3 //$dbhw usuario com direito de escrita
4 4 try
5 5 {
6   - $dbh = new PDO('pgsql:dbname=teste;user=postgres;password=postgres;host=localhost');
7   - $dbhw = new PDO('pgsql:dbname=teste;user=postgres;password=postgres;host=localhost');
  6 + $dbh = new PDO('pgsql:dbname=geodados;user=postgres;password=postgres;host=localhost');
  7 + $dbhw = new PDO('pgsql:dbname=geodados;user=postgres;password=postgres;host=localhost');
8 8 }
9 9 catch (PDOException $e)
10 10 {
... ...
admin/php/editormapfile.php
... ... @@ -333,7 +333,7 @@ switch (strtoupper($funcao))
333 333 }
334 334 $tabela = "i3geoadmin_temas";
335 335 if($id){
336   - exclui($tabela,$coluna,$id);
  336 + exclui($esquemaadmin.$tabela,$coluna,$id);
337 337 }
338 338 retornaJSON("ok");
339 339 exit;
... ...
admin/php/logtransacoes.php 0 → 100644
... ... @@ -0,0 +1,16 @@
  1 +<?php
  2 +//para rodar, comente a linha abaixo
  3 +exit;
  4 +include("admin.php");
  5 +$dados = pegaDados("select * from ".$esquemaadmin."i3geoadmin_log");
  6 +//["serializedata"]=> string(96) "a:5:{i:0;s:22:"administrador do i3geo";i:1;s:10:"admingeral";i:2;s:0:"";i:3;s:1:"1";i:4;s:0:"";}" ["usuario"]=> string(5) "admin" ["ip"]=> string(9) "127.0.0.1" ["timestamp"]=> string(43) "1458610085(Mon, 21 Mar 2016 22:28:05 -0300)" ["outros"]=> string(0) "" } }
  7 +foreach($dados as $d){
  8 + echo "<b>id_log:</b> ".$d["id_log"]."<br> \n";
  9 + echo "timestamp = ".$d["timestamp"] ."<br> \n";
  10 + echo "usuario = ".$d["usuario"] ."<br> \n";
  11 + echo "ip = ".$d["ip"] ."<br> \n";
  12 + echo "sql = ".$d["sql"] ."<br> \n";
  13 + echo "dados = '".implode("','",unserialize($d["serializedata"])) ."'<br> \n";
  14 + echo "outros = ".$d["outros"] ."<br><br> \n";
  15 +}
  16 +?>
0 17 \ No newline at end of file
... ...
admin/php/menutemas.php
... ... @@ -598,13 +598,12 @@ switch (strtoupper($funcao))
598 598 $tabela = "i3geoadmin_menus";
599 599 $coluna = "id_menu";
600 600 $filhos = verificaFilhos();
601   - if($filhos)
602   - {
  601 + if($filhos){
603 602 retornaJSON("erro");
604 603 exit;
605 604 }
606 605 }
607   - retornaJSON(exclui($tabela,$coluna,$id));
  606 + retornaJSON(exclui($esquemaadmin.$tabela,$coluna,$id));
608 607 exit;
609 608 break;
610 609  
... ...
ms_configura.php
... ... @@ -71,8 +71,12 @@ Para que isso funcione e necessario que exista a tabela que armazena o log.
71 71  
72 72 Se voce possui um banco de administracao anterior a versao 7, utilize o seguinte sql para criar a tabela
73 73  
  74 +- caso esteja utilizando SQLlite:
74 75 CREATE TABLE i3geoadmin_log (id_log INTEGER PRIMARY KEY,sql TEXT,serializedata TEXT,usuario TEXT,ip TEXT,timestamp TEXT,outros TEXT)
75 76  
  77 +- caso esteja utilizando postgesql:
  78 +CREATE TABLE i3geoadmin.i3geoadmin_log (id_log SERIAL PRIMARY KEY NOT NULL,sql TEXT,serializedata TEXT,usuario TEXT,ip TEXT,timestamp TEXT,outros TEXT);
  79 +
76 80 Tipo:
77 81 {boolean}
78 82  
... ...