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,7 +115,6 @@ switch (strtoupper($funcao)) | ||
115 | $usuario = $_POST["usuario"]; | 115 | $usuario = $_POST["usuario"]; |
116 | $senha = $_POST["senha"]; | 116 | $senha = $_POST["senha"]; |
117 | $teste = autenticaUsuario($usuario,$senha); | 117 | $teste = autenticaUsuario($usuario,$senha); |
118 | - | ||
119 | if($teste == "muitas tentativas"){ | 118 | if($teste == "muitas tentativas"){ |
120 | logoutUsuario(); | 119 | logoutUsuario(); |
121 | header ( "HTTP/1.1 403 Muitas tentativas" ); | 120 | header ( "HTTP/1.1 403 Muitas tentativas" ); |
@@ -351,7 +350,7 @@ function autenticaUsuario($usuario,$senha){ | @@ -351,7 +350,7 @@ function autenticaUsuario($usuario,$senha){ | ||
351 | $dados = array(); | 350 | $dados = array(); |
352 | //por causa das versoes antigas do PHP | 351 | //por causa das versoes antigas do PHP |
353 | if(strlen($senha) == 32 || !function_exists("password_hash") ){ | 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 | if(count($dados) == 1 && $dados[0]["senha"] == $senhamd5 && $dados[0]["login"] == $usuario){ | 354 | if(count($dados) == 1 && $dados[0]["senha"] == $senhamd5 && $dados[0]["login"] == $usuario){ |
356 | $ok = true; | 355 | $ok = true; |
357 | } | 356 | } |
admin/php/usuarios.php
@@ -148,7 +148,12 @@ function enviarSenhaEmail(){ | @@ -148,7 +148,12 @@ function enviarSenhaEmail(){ | ||
148 | $novaSenha = rand(9000,1000000); | 148 | $novaSenha = rand(9000,1000000); |
149 | $dados = pegaDados("select * from ".$esquemaadmin."i3geousr_usuarios where id_usuario = $id_usuario and ativo = 1"); | 149 | $dados = pegaDados("select * from ".$esquemaadmin."i3geousr_usuarios where id_usuario = $id_usuario and ativo = 1"); |
150 | if(count($dados) > 0){ | 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 | $sql = "UPDATE ".$esquemaadmin."i3geousr_usuarios SET senha='$senha' WHERE id_usuario = $id_usuario"; | 157 | $sql = "UPDATE ".$esquemaadmin."i3geousr_usuarios SET senha='$senha' WHERE id_usuario = $id_usuario"; |
153 | $dbhw->query($sql); | 158 | $dbhw->query($sql); |
154 | i3GeoAdminInsertLog($dbhw,$sql); | 159 | i3GeoAdminInsertLog($dbhw,$sql); |
@@ -186,8 +191,11 @@ function alterarUsuarios() | @@ -186,8 +191,11 @@ function alterarUsuarios() | ||
186 | ); | 191 | ); |
187 | //se a senha foi enviada, ela sera trocada | 192 | //se a senha foi enviada, ela sera trocada |
188 | if($_GET["senha"] != ""){ | 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 | i3GeoAdminUpdate($dbhw,"i3geousr_usuarios",$dataCol,"WHERE id_usuario = $id_usuario"); | 200 | i3GeoAdminUpdate($dbhw,"i3geousr_usuarios",$dataCol,"WHERE id_usuario = $id_usuario"); |
193 | $retorna = $id_usuario; | 201 | $retorna = $id_usuario; |
admin1/index.php
@@ -107,7 +107,12 @@ include "head.php"; | @@ -107,7 +107,12 @@ include "head.php"; | ||
107 | $(".hidden").removeClass('hidden'); | 107 | $(".hidden").removeClass('hidden'); |
108 | $.material.init(); | 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 | </script> | 116 | </script> |
112 | </body> | 117 | </body> |
113 | </html> | 118 | </html> |
admin1/php/checaLogin.php
@@ -37,6 +37,17 @@ if (isset ( $_GET )) { | @@ -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 | // variaveis mais comuns | 51 | // variaveis mais comuns |
41 | $funcao = isset($_GET['funcao']) ? $_GET['funcao'] : ''; | 52 | $funcao = isset($_GET['funcao']) ? $_GET['funcao'] : ''; |
42 | $perfil = isset($_GET['perfil']) ? $_GET['perfil'] : ''; | 53 | $perfil = isset($_GET['perfil']) ? $_GET['perfil'] : ''; |
admin1/usuarios/cadastro/exec.php
@@ -57,11 +57,11 @@ switch ($funcao) { | @@ -57,11 +57,11 @@ switch ($funcao) { | ||
57 | $dbhw = null; | 57 | $dbhw = null; |
58 | $dbh = null; | 58 | $dbh = null; |
59 | if ($novo != false) { | 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 | header ( "HTTP/1.1 500 para enviar a senha é necessário preencher o valor de senha e e-mail" ); | 62 | header ( "HTTP/1.1 500 para enviar a senha é necessário preencher o valor de senha e e-mail" ); |
63 | } else { | 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 | } else { | 67 | } else { |
@@ -75,11 +75,11 @@ switch ($funcao) { | @@ -75,11 +75,11 @@ switch ($funcao) { | ||
75 | if ($novo === false) { | 75 | if ($novo === false) { |
76 | header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | 76 | header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); |
77 | } else { | 77 | } else { |
78 | - if (strtolower ( $enviaSenha ) == "on") { | ||
79 | - if ($senha == "" || $email == "") { | 78 | + if (strtolower ( $_POST["enviaSenha"] ) == "on") { |
79 | + if ($_POST["senha"] == "" || $_POST["email"] == "") { | ||
80 | $dados = header ( "HTTP/1.1 500 para enviar a senha é necessário preencher o valor de senha e e-mail" ); | 80 | $dados = header ( "HTTP/1.1 500 para enviar a senha é necessário preencher o valor de senha e e-mail" ); |
81 | } else { | 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,7 +85,7 @@ function alterar($id_usuario, $ativo, $data_cadastro, $email, $login, $nome_usua | ||
85 | if(!function_exists("password_hash")){ | 85 | if(!function_exists("password_hash")){ |
86 | $dataCol ["senha"] = md5 ( $senha ); | 86 | $dataCol ["senha"] = md5 ( $senha ); |
87 | } else { | 87 | } else { |
88 | - $dataCol["senha"] = password_hash($_GET["senha"], PASSWORD_DEFAULT); | 88 | + $dataCol["senha"] = password_hash($senha, PASSWORD_DEFAULT); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | $resultado = \admin\php\funcoesAdmin\i3GeoAdminUpdate ( $dbhw, "i3geousr_usuarios", $dataCol, "WHERE id_usuario = $id_usuario" ); | 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