Commit 8c98db4c5358301efe2c9031fd13505b5b603306
1 parent
ee1b8ed5
Exists in
master
and in
7 other branches
Conclusão da implantação do log de transações #62
Showing
6 changed files
with
26 additions
and
7 deletions
Show diff stats
admin/php/arvore.php
admin/php/conexaopostgresql.php
@@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
3 | //$dbhw usuario com direito de escrita | 3 | //$dbhw usuario com direito de escrita |
4 | try | 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 | catch (PDOException $e) | 9 | catch (PDOException $e) |
10 | { | 10 | { |
admin/php/editormapfile.php
@@ -333,7 +333,7 @@ switch (strtoupper($funcao)) | @@ -333,7 +333,7 @@ switch (strtoupper($funcao)) | ||
333 | } | 333 | } |
334 | $tabela = "i3geoadmin_temas"; | 334 | $tabela = "i3geoadmin_temas"; |
335 | if($id){ | 335 | if($id){ |
336 | - exclui($tabela,$coluna,$id); | 336 | + exclui($esquemaadmin.$tabela,$coluna,$id); |
337 | } | 337 | } |
338 | retornaJSON("ok"); | 338 | retornaJSON("ok"); |
339 | exit; | 339 | exit; |
@@ -0,0 +1,16 @@ | @@ -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 | \ No newline at end of file | 17 | \ No newline at end of file |
admin/php/menutemas.php
@@ -598,13 +598,12 @@ switch (strtoupper($funcao)) | @@ -598,13 +598,12 @@ switch (strtoupper($funcao)) | ||
598 | $tabela = "i3geoadmin_menus"; | 598 | $tabela = "i3geoadmin_menus"; |
599 | $coluna = "id_menu"; | 599 | $coluna = "id_menu"; |
600 | $filhos = verificaFilhos(); | 600 | $filhos = verificaFilhos(); |
601 | - if($filhos) | ||
602 | - { | 601 | + if($filhos){ |
603 | retornaJSON("erro"); | 602 | retornaJSON("erro"); |
604 | exit; | 603 | exit; |
605 | } | 604 | } |
606 | } | 605 | } |
607 | - retornaJSON(exclui($tabela,$coluna,$id)); | 606 | + retornaJSON(exclui($esquemaadmin.$tabela,$coluna,$id)); |
608 | exit; | 607 | exit; |
609 | break; | 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,8 +71,12 @@ Para que isso funcione e necessario que exista a tabela que armazena o log. | ||
71 | 71 | ||
72 | Se voce possui um banco de administracao anterior a versao 7, utilize o seguinte sql para criar a tabela | 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 | CREATE TABLE i3geoadmin_log (id_log INTEGER PRIMARY KEY,sql TEXT,serializedata TEXT,usuario TEXT,ip TEXT,timestamp TEXT,outros TEXT) | 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 | Tipo: | 80 | Tipo: |
77 | {boolean} | 81 | {boolean} |
78 | 82 |