User

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

Properties

Name Type Description
$ID number user ID
$FIELDS array user field Dictionary
$GROUPS array List of user groups
$user_id = \BlackFox\User::I()->ID;
$user_login = \BlackFox\User::I()->FIELDS['LOGIN'];
$is_authorized = \BlackFox\User::I()->IsAuthorized();
$is_root = \BlackFox\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