meraproject/module/core/user/account/controller.php
keboss-m 5c21d25d45 Initial commit: Merakomis portal, Docker stack and user-reader API.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:04:05 +03:00

33 lines
929 B
PHP

<?
namespace controller\core\user\account;
class Api extends \core\core\structure\ControllerTable {
static $class = '\Account';
function reg(){
echo je(\Account::reg($_POST));
}
function login(){
echo je(\Account::login($_POST['login'],$_POST['pass']));
}
function exit(){
\Account::exit();
echo je(array());
}
public static function getNameList() {
$res = [];
if(\Account::$isSuper || IF_AUTH) {
$q = (string)trim($_POST['q']);
$res = \Account::getNameList([
\Query::WHERE => new \Where(\Where::_or([
\Where::_operator( \Account::$ID,'LIKE','%'.$q.'%' ),
\Where::_operator( \Account::$NAME,'LIKE','%'.$q.'%' ),
\Where::_operator( \Account::$EMAIL,'LIKE','%'.$q.'%' ),
]))
]);
}
echo je($res);
}
}