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

30 lines
643 B
PHP
Raw Permalink 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();
2023-03-07 11:25:14 +00:00
$res = $sql->quickExec1Line("select * from `" . user::$sqlTable . "` where `login` = '" . common::clearInput($login) . "' and `secret` = '" . xcrypt::hash($password) . "' and `active`=1 and `deleted`=0");
2022-04-26 19:48:03 +00:00
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;
}
}
}
?>