Commit b4ca27a57f83e8b16561ab51dc515fd2ebf980ff
1 parent
cf017ae9
Exists in
master
and in
7 other branches
Correção no login de usuários em ambiente windows com PHP antigo
Showing
62 changed files
with
36 additions
and
13 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/php/login.php
... | ... | @@ -115,7 +115,6 @@ switch (strtoupper($funcao)) |
115 | 115 | $usuario = $_POST["usuario"]; |
116 | 116 | $senha = $_POST["senha"]; |
117 | 117 | $teste = autenticaUsuario($usuario,$senha); |
118 | - | |
119 | 118 | if($teste == "muitas tentativas"){ |
120 | 119 | logoutUsuario(); |
121 | 120 | header ( "HTTP/1.1 403 Muitas tentativas" ); |
... | ... | @@ -351,7 +350,7 @@ function autenticaUsuario($usuario,$senha){ |
351 | 350 | $dados = array(); |
352 | 351 | //por causa das versoes antigas do PHP |
353 | 352 | if(strlen($senha) == 32 || !function_exists("password_hash") ){ |
354 | - $dados = pegaDados("select id_usuario,nome_usuario from ".$esquemaadmin."i3geousr_usuarios where login = '$usuario' and senha = '$senhamd5' and ativo = 1",$dbh,false); | |
353 | + $dados = pegaDados("select senha,login,id_usuario,nome_usuario from ".$esquemaadmin."i3geousr_usuarios where login = '$usuario' and senha = '$senhamd5' and ativo = 1",$dbh,false); | |
355 | 354 | if(count($dados) == 1 && $dados[0]["senha"] == $senhamd5 && $dados[0]["login"] == $usuario){ |
356 | 355 | $ok = true; |
357 | 356 | } | ... | ... |
admin/php/usuarios.php
... | ... | @@ -148,7 +148,12 @@ function enviarSenhaEmail(){ |
148 | 148 | $novaSenha = rand(9000,1000000); |
149 | 149 | $dados = pegaDados("select * from ".$esquemaadmin."i3geousr_usuarios where id_usuario = $id_usuario and ativo = 1"); |
150 | 150 | if(count($dados) > 0){ |
151 | - $senha = md5($novaSenha); | |
151 | + //$senha = md5($novaSenha); | |
152 | + if(!function_exists("password_hash")){ | |
153 | + $senha = md5($novaSenha); | |
154 | + } else { | |
155 | + $senha = password_hash($novaSenha, PASSWORD_DEFAULT); | |
156 | + } | |
152 | 157 | $sql = "UPDATE ".$esquemaadmin."i3geousr_usuarios SET senha='$senha' WHERE id_usuario = $id_usuario"; |
153 | 158 | $dbhw->query($sql); |
154 | 159 | i3GeoAdminInsertLog($dbhw,$sql); |
... | ... | @@ -186,8 +191,11 @@ function alterarUsuarios() |
186 | 191 | ); |
187 | 192 | //se a senha foi enviada, ela sera trocada |
188 | 193 | if($_GET["senha"] != ""){ |
189 | - //$dataCol["senha"] = md5($_GET["senha"]); | |
190 | - $dataCol["senha"] = password_hash($_GET["senha"], PASSWORD_DEFAULT); | |
194 | + if(!function_exists("password_hash")){ | |
195 | + $dataCol["senha"] = md5($_GET["senha"]); | |
196 | + } else { | |
197 | + $dataCol["senha"] = password_hash($_GET["senha"], PASSWORD_DEFAULT); | |
198 | + } | |
191 | 199 | } |
192 | 200 | i3GeoAdminUpdate($dbhw,"i3geousr_usuarios",$dataCol,"WHERE id_usuario = $id_usuario"); |
193 | 201 | $retorna = $id_usuario; | ... | ... |
admin1/index.php
... | ... | @@ -107,7 +107,12 @@ include "head.php"; |
107 | 107 | $(".hidden").removeClass('hidden'); |
108 | 108 | $.material.init(); |
109 | 109 | }; |
110 | - i3GEO.login.verificaOperacao("admin/html/identifica",i3GEO.configura.locaplic, inicia, "sessao" ,i3GEOadmin.core.erroLogin); | |
110 | + if(i3GEO.login.verificaCookieLogin() == true){ | |
111 | + inicia(); | |
112 | + } else { | |
113 | + i3GEOadmin.core.erroLogin(); | |
114 | + } | |
115 | + //i3GEO.login.verificaOperacao("admin/html/identifica",i3GEO.configura.locaplic, inicia, "sessao" ,i3GEOadmin.core.erroLogin); | |
111 | 116 | </script> |
112 | 117 | </body> |
113 | 118 | </html> | ... | ... |
admin1/php/checaLogin.php
... | ... | @@ -37,6 +37,17 @@ if (isset ( $_GET )) { |
37 | 37 | } |
38 | 38 | } |
39 | 39 | } |
40 | +if (isset ( $_POST )) { | |
41 | + foreach ( array_keys ( $_POST ) as $k ) { | |
42 | + $k = str_ireplace ( $bl, "", $k ); | |
43 | + $k = filter_var ( $k, FILTER_SANITIZE_STRING ); | |
44 | + if ($_POST [$k] != "''") { | |
45 | + $v = strip_tags ( $_POST [$k] ); | |
46 | + $v = str_ireplace ( $bl, "", $v ); | |
47 | + $_POST [$k] = trim ( $v ); | |
48 | + } | |
49 | + } | |
50 | +} | |
40 | 51 | // variaveis mais comuns |
41 | 52 | $funcao = isset($_GET['funcao']) ? $_GET['funcao'] : ''; |
42 | 53 | $perfil = isset($_GET['perfil']) ? $_GET['perfil'] : ''; | ... | ... |
admin1/usuarios/cadastro/exec.php
... | ... | @@ -57,11 +57,11 @@ switch ($funcao) { |
57 | 57 | $dbhw = null; |
58 | 58 | $dbh = null; |
59 | 59 | if ($novo != false) { |
60 | - if (strtolower ( $enviaSenha ) == "on") { | |
61 | - if ($senha == "" || $email == "") { | |
60 | + if (strtolower ( $_POST["enviaSenha"] ) == "on") { | |
61 | + if ($_POST["senha"] == "" || $_POST["email"] == "") { | |
62 | 62 | header ( "HTTP/1.1 500 para enviar a senha é necessário preencher o valor de senha e e-mail" ); |
63 | 63 | } else { |
64 | - $dados = \admin\usuarios\cadastro\enviarSenha ( $senha, $email ); | |
64 | + $dados = \admin\usuarios\cadastro\enviarSenha ( $_POST["senha"], $_POST["email"] ); | |
65 | 65 | } |
66 | 66 | } |
67 | 67 | } else { |
... | ... | @@ -75,11 +75,11 @@ switch ($funcao) { |
75 | 75 | if ($novo === false) { |
76 | 76 | header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); |
77 | 77 | } else { |
78 | - if (strtolower ( $enviaSenha ) == "on") { | |
79 | - if ($senha == "" || $email == "") { | |
78 | + if (strtolower ( $_POST["enviaSenha"] ) == "on") { | |
79 | + if ($_POST["senha"] == "" || $_POST["email"] == "") { | |
80 | 80 | $dados = header ( "HTTP/1.1 500 para enviar a senha é necessário preencher o valor de senha e e-mail" ); |
81 | 81 | } else { |
82 | - $dados = \admin\usuarios\cadastro\enviarSenha ( $senha, $email ); | |
82 | + $dados = \admin\usuarios\cadastro\enviarSenha ( $_POST["senha"], $_POST["email"] ); | |
83 | 83 | } |
84 | 84 | } |
85 | 85 | } | ... | ... |
admin1/usuarios/cadastro/funcoes.php
... | ... | @@ -85,7 +85,7 @@ function alterar($id_usuario, $ativo, $data_cadastro, $email, $login, $nome_usua |
85 | 85 | if(!function_exists("password_hash")){ |
86 | 86 | $dataCol ["senha"] = md5 ( $senha ); |
87 | 87 | } else { |
88 | - $dataCol["senha"] = password_hash($_GET["senha"], PASSWORD_DEFAULT); | |
88 | + $dataCol["senha"] = password_hash($senha, PASSWORD_DEFAULT); | |
89 | 89 | } |
90 | 90 | } |
91 | 91 | $resultado = \admin\php\funcoesAdmin\i3GeoAdminUpdate ( $dbhw, "i3geousr_usuarios", $dataCol, "WHERE id_usuario = $id_usuario" ); | ... | ... |
pacotes/yui290/build/container/container_compacto.js
100644 → 100755
pacotes/yui290/build/container/container_core_compacto.js
100644 → 100755
pacotes/yui290/build/utilities/utilities_compacto.js
100644 → 100755