User

Class System\User designed to work with the session of the current user.
In engine, unit, and SCRUD contexts, it is accessible via $this->USER->; in other contexts — via \System\User::I()->

Properties

Name Type Description
$ID number user ID
$FIELDS array user field Dictionary
$GROUPS array List of user groups
$user_id = \System\User::I()->ID;
$user_login = \System\User::I()->FIELDS['LOGIN'];
$is_authorized = \System\User::I()->IsAuthorized();
$is_root = \System\User::I()->InGroup('root');

Methods

Name Parameters Description
Load $ID Loads user data
Authorization $login, $password Attempts to authorize the user with the specified credentials
Login $ID Authorizes the user with the specified ID
Logout Deauthorizes the user
IsAuthorized Returns true if the user is authorized
InGroup $group Returns true if the user belongs to the specified group
Ask question