Commit ebf0aac3a7a0f9abfbf4231688ce437413c3894d
1 parent
9fcd55ba
Exists in
master
and in
7 other branches
Correção no login quando a conexão é postgres
Showing
9 changed files
with
21 additions
and
8 deletions
Show diff stats
admin/php/admin.php
... | ... | @@ -93,7 +93,7 @@ function retornaJSON($obj) |
93 | 93 | //else |
94 | 94 | //{ |
95 | 95 | include_once($locaplic."/pacotes/cpaint/JSON/json2.php"); |
96 | - //error_reporting(0); | |
96 | + error_reporting(0); | |
97 | 97 | ob_end_clean(); |
98 | 98 | $j = new Services_JSON(); |
99 | 99 | $texto = $j->encode($obj); |
... | ... | @@ -190,11 +190,10 @@ Array originada de fetchAll |
190 | 190 | */ |
191 | 191 | function pegaDados($sql,$dbh="",$close=true) |
192 | 192 | { |
193 | - error_reporting(0); | |
194 | 193 | $resultado = array(); |
195 | 194 | //is_string para efeitos de compatibilidade |
196 | 195 | if($dbh == "" || is_string($dbh)){ |
197 | - include(dirname(__FILE__)."/../../admin1/php/conexao.php"); | |
196 | + include(dirname(__FILE__)."/../../admin/php/conexao.php"); | |
198 | 197 | } |
199 | 198 | error_reporting(0); |
200 | 199 | //$dbh deve ser definido com somente leitura, mas por prevencao: | ... | ... |
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=loc;user=postgres;password=postgres;host=localhost'); | |
7 | - $dbhw = new PDO('pgsql:dbname=loc;user=postgres;password=postgres;host=localhost'); | |
6 | + $dbh = new PDO('pgsql:dbname=i3geosaude;user=postgres;password=postgres;host=localhost'); | |
7 | + $dbhw = new PDO('pgsql:dbname=i3geosaude;user=postgres;password=postgres;host=localhost'); | |
8 | 8 | } |
9 | 9 | catch (PDOException $e) |
10 | 10 | { | ... | ... |
admin1/cadastros/tags/exec.php
... | ... | @@ -9,8 +9,10 @@ |
9 | 9 | // |
10 | 10 | include ("../../php/checaLogin.php"); |
11 | 11 | \admin\php\login\checaLogin(); |
12 | + | |
12 | 13 | //funcoes de administracao |
13 | 14 | include ($_SESSION["locaplic"]."/admin1/php/funcoesAdmin.php"); |
15 | + | |
14 | 16 | // |
15 | 17 | //carrega outras funcoes e extensoes do PHP |
16 | 18 | // |
... | ... | @@ -24,12 +26,15 @@ include ("funcoes.php"); |
24 | 26 | //conexao com o banco de administracao |
25 | 27 | //cria as variaveis $dbh e $dbhw alem de conexaoadmin |
26 | 28 | // |
29 | + | |
27 | 30 | include ($_SESSION["locaplic"]."/admin1/php/conexao.php"); |
31 | + | |
28 | 32 | /***************************************************************/ |
29 | 33 | if (\admin\php\funcoesAdmin\verificaOperacaoSessao ( "admin/html/arvore" ) === false) { |
30 | 34 | header ( "HTTP/1.1 403 Vc nao pode realizar essa operacao" ); |
31 | 35 | exit (); |
32 | 36 | } |
37 | + | |
33 | 38 | //remove espaco em branco do nome do tag |
34 | 39 | $nome = str_replace(" ","",$_POST["nome"]); |
35 | 40 | $id_tag = $_POST["id_tag"]; |
... | ... | @@ -64,7 +69,7 @@ switch ($funcao) { |
64 | 69 | } |
65 | 70 | break; |
66 | 71 | case "LISTA" : |
67 | - $dados = \admin\cadastros\tags\listar ( $dbh ); | |
72 | + $dados = \admin\cadastros\tags\listar ( $dbh ); | |
68 | 73 | $dbhw = null; |
69 | 74 | $dbh = null; |
70 | 75 | if ($dados === false) { | ... | ... |
admin1/cadastros/tags/funcoes.php
... | ... | @@ -2,7 +2,8 @@ |
2 | 2 | namespace admin\cadastros\tags; |
3 | 3 | use PDOException; |
4 | 4 | function listar($dbh, $id_tag = ""){ |
5 | - $esquemaadmin = $_SESSION["esquemaadmin"]; | |
5 | + | |
6 | + $esquemaadmin = $_SESSION["esquemaadmin"]; | |
6 | 7 | if($id_tag != ""){ |
7 | 8 | $dados = \admin\php\funcoesAdmin\pegaDados ( "SELECT id_tag, nome from ".$esquemaadmin."i3geoadmin_tags WHERE id_tag = $id_tag ", $dbh, false ); |
8 | 9 | $dados = $dados[0]; | ... | ... |
admin1/cadastros/tags/index.php
admin1/php/conexao.php
... | ... | @@ -10,6 +10,10 @@ if(!isset($conexaoadmin)){ |
10 | 10 | if(!isset($logTransacoes)){ |
11 | 11 | $logTransacoes = false; |
12 | 12 | } |
13 | +$esquemaadmin = $_SESSION["esquemaadmin"]; | |
14 | +if(!isset($esquemaadmin)){ | |
15 | + $esquemaadmin = ""; | |
16 | +} | |
13 | 17 | // |
14 | 18 | //indica se deve ser feita a conversão para UTF8 ao gravar os dados |
15 | 19 | // | ... | ... |
admin1/php/funcoesAdmin.php
admin1/php/login.php
... | ... | @@ -45,6 +45,7 @@ if(!empty($_POST["usuario"]) && !empty($_POST["senha"])){ |
45 | 45 | $funcao = "login"; |
46 | 46 | $_SESSION["locaplic"] = $locaplic; |
47 | 47 | $_SESSION["conexaoadmin"] = $conexaoadmin; |
48 | + $_SESSION["esquemaadmin"] = str_replace(".","",$esquemaadmin)."."; | |
48 | 49 | } |
49 | 50 | else{//se nao, verifica se o login ja existe realmente |
50 | 51 | if(!empty($_COOKIE["i3geocodigologin"])){ |
... | ... | @@ -251,7 +252,7 @@ function validaSessao(){ |
251 | 252 | //registra as operacoes, papeis e grupos do usuario na SESSION |
252 | 253 | // |
253 | 254 | function autenticaUsuario($usuario,$senha,$dir_tmp,$i3geomaster){ |
254 | - include(dirname(__FILE__)."/conexao.php"); | |
255 | + include(dirname(__FILE__)."/conexao.php"); | |
255 | 256 | error_reporting(0); |
256 | 257 | $senhamd5 = md5($senha); |
257 | 258 | if(function_exists("password_hash")){ | ... | ... |
classesphp/funcoes_gerais.php
... | ... | @@ -2892,6 +2892,7 @@ Lista os layers de um mapfile que sao restritos e que nao sao permitidos ao usua |
2892 | 2892 | function listaLayersIndevidos($map_file){ |
2893 | 2893 | //error_reporting(0); |
2894 | 2894 | $indevidos = array(); |
2895 | + | |
2895 | 2896 | $restritos = listaTemasRestritos(); |
2896 | 2897 | if(count($restritos) > 0){ |
2897 | 2898 | $gruposusr = listaGruposUsrLogin(); | ... | ... |