X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/5836c69357427ed50520eb9bcb59f980cb452654..c2de4e857201181b73e0da3064f53ff5cc8ce2f0:/lib/MECON/Usuario.php?ds=inline diff --git a/lib/MECON/Usuario.php b/lib/MECON/Usuario.php index d8ef1eb..bdfd064 100644 --- a/lib/MECON/Usuario.php +++ b/lib/MECON/Usuario.php @@ -270,5 +270,32 @@ class MECON_Usuario { } // -X2C + /** + * Verifica si el login pasado por parametro es valido + * + * @param string $login Login a verificar + * + * @return mixed + * @access public + */ + function verificarLogin($login = null) { + if ($login) { + $db = DB::connect($this->dsn); + if (PEAR::isError($db)) { + return $db; + } + $sql = "SELECT count(*) as cuenta FROM Usuario WHERE login = '$login'"; + $result = $db->query($sql); + if (PEAR::isError($result)) { + return $result; + } + $row = $result->fetchRow(DB_FETCHMODE_ASSOC); + if ($row['cuenta'] != 0) { + return true; + } + } + return false; + } + } // -X2C Class :MECON_Usuario ?> \ No newline at end of file