Bitrix Site Manager


CUser is the class to deal with the user-specific information.

An instance of this class ($USER) is created automatically at run of every page.


Field Type Description
ID int User ID.
XML_ID int User ID for binding to external sources (e.g. the ID of a user in an external database).
TIMESTAMP_X datetime Date and time of the last modification.
LOGIN varchar (50) Login name.
PASSWORD varchar (50) Password hash.
STORED_HASH varchar (32) Password hash stored in the user cookie.
CHECKWORD varchar (50) Check string used for the password change.
ACTIVE char Flag indicating the user is active (Y|N).
NAME varchar (50) First name.
LAST_NAME varchar (50) Last name.
EMAIL varchar (255) E-mail address.
LAST_LOGIN datetime Date of the last authorization.
DATE_REGISTER datetime Date the user has been registered.
LID char (2) The ID of the default site used for notifications.
ADMIN_NOTES varchar (2000) Administrator comments.
EXTERNAL_AUTH_ID varchar (255) The ID of the external authorization source.
Personal data
PERSONAL_PROFESSION varchar (255) Position/job.
PERSONAL_WWW varchar (255) Web page.
PERSONAL_ICQ varchar (255) ICQ number.
PERSONAL_BIRTHDAY date Date of birth.
PERSONAL_PHONE varchar (255) Phone number.
PERSONAL_FAX varchar (255) Fax number.
PERSONAL_MOBILE varchar (255) Mobile number.
PERSONAL_PAGER varchar (255) Pager.
PERSONAL_STREET varchar (2000) Street address.
PERSONAL_MAILBOX varchar (255) Mailbox number.
PERSONAL_CITY varchar (255) City.
PERSONAL_STATE varchar (255) State or region.
PERSONAL_ZIP varchar (255) Zip code.
PERSONAL_COUNTRY varchar (255) Country.
PERSONAL_NOTES varchar (2000) Additional notes.
Job information
WORK_COMPANY varchar (255) Company name.
WORK_DEPARTMENT varchar (255) Web page.
WORK_POSITION varchar (255) Department.
WORK_WWW varchar (255) Position.
WORK_PHONE varchar (255) Phone.
WORK_FAX varchar (255) Fax.
WORK_PAGER varchar (255) Pager.
WORK_STREET varchar (2000) Street address.
WORK_MAILBOX varchar (255) Mailbox number.
WORK_CITY varchar (255) City.
WORK_STATE varchar (255) State or region.
WORK_ZIP varchar (255) Zip code.
WORK_COUNTRY varchar (255) Country.
WORK_PROFILE varchar (2000) Company profile.
WORK_LOGO int Company logo.
WORK_NOTES varchar (2000) Additional notes.

Class methods

Method Description
GetList Returns a list of users.
GetByID Returns a user by its ID.
GetByLogin Returns a user by the login.
GetUserGroup Returns an array of ID's of groups containing the specified user.
Add Adds a new user.
Update Modifies parameters of the user.
Delete Deletes a user.
GetID Returns the authorized user ID.
GetLogin Returns the login of the currently authorized user.
GetEmail Returns the e-mail address of the currently authorized user.
GetFullName Returns the first and last names of the authorized user.
GetFirstName Returns the authorized user name.
GetLastName Returns the last name of the authorized user.
GetParam Returns one of the user parameters stored in the authorization session.
GetUserGroupArray Returns the ID's of groups containing the current authorized user.
GetUserGroupString Returns a string with comma-separated ID's of all groups containing the current authorized user.
IsAdmin Checks if the current authorized user belongs to the Administrators group.
IsAuthorized Checks if the site visitor has been authorized.
Login Verifies the login and password and performs or declines the user authorization.
LoginByHash Verifies the login and a password hash string performs or declines the user authorization.
SavePasswordHash Stores the special hash string in the user cookie for future automatic authorization.
GetPasswordHash Returns a hash string on the user password that can be used with functions LoginByHash and SavePasswordHash.
Authorize Implements the user authorization procedure. Initialises both session and CUser variables.
Logout Ends the user authorized session.
Register Registers and authorizes a new user.
SimpleRegister Creates a new user by generating the random login and password.
ChangePassword Modifies the user password.
SendPassword Sends a message with the control string used for password change.
SendUserInfo Sends an e-mail message with the user preferences.
GetCount Returns the number of users registered with the site.