From 4004ec643157ebf5e77f4ef192acfdf5acacb541 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 5 May 2005 06:01:33 +0000 Subject: [PATCH] =?utf8?q?Se=20crea=20un=20m=C3=A9todo=20getPassword()=20p?= =?utf8?q?orque=20al=20usar=20Usuario::validar()=20creaba=20una=20entrada?= =?utf8?q?=20en=20el=20log=20como=20intento=20de=20login.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/lib/Usuario.php | 7 +++++++ src/lib/validacion.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/Usuario.php b/src/lib/Usuario.php index 17fc236..bf18d9e 100644 --- a/src/lib/Usuario.php +++ b/src/lib/Usuario.php @@ -28,12 +28,14 @@ class Usuario var $_id; var $_nombre; var $_apellido; + var $_pass; var $_email; function Usuario($id) { $this->_id = $id; $d = file_users_get($id); + $this->_pass = $d[1]; $this->_email = $d[2]; if ($this->esAsesor()) $d = file_ase_get($id); else $d = file_int_get($id); @@ -46,6 +48,11 @@ class Usuario return $this->_id; } + function getPassword() + { + return $this->_pass; + } + function getNombre() { return $this->_nombre; diff --git a/src/lib/validacion.php b/src/lib/validacion.php index 94110eb..04f51cd 100644 --- a/src/lib/validacion.php +++ b/src/lib/validacion.php @@ -154,7 +154,7 @@ function check_asociado($user) /// Verifica que sea la password correcta. function check_password($user, $pass) { - if (Usuario::validar($user, $pass)) return true; + if ($user->getPassword() == $pass) return true; error('ContraseƱa incorrecta!'); return false; } -- 2.43.0