chimera-mark2-core-release/core/fox/auth.php

30 lines
612 B
PHP
Raw Normal View History

2022-04-26 19:48:03 +00:00
<?php
namespace fox;
/**
*
* Class fox\auth
*
* @copyright MX STAR LLC 2018-2022
* @version 4.0.0
* @author Pavel Dmitriev
* @license GPLv3
*
**/
class auth extends baseClass implements noSqlMigration
{
public static function doAuth($login, $password)
{
$sql = sql::getConnection();
$res = $sql->quickExec1Line("select * from `" . user::$sqlTable . "` where `login` = '" . common::clearInput($login) . "' and `secret` = '" . xcrypt::hash($password) . "'");
if ($res) {
2022-05-12 13:59:48 +00:00
return new user($res);
2022-04-26 19:48:03 +00:00
} else {
return false;
}
}
}
?>