Bitrix Site Manager

CUser::SimpleRegister

array
CUser::SimpleRegister(
 string email,
 string site_id = SITE_ID
)

The method SimpleRegister creates a new user by generating the random login and password. The method returns an array containing the execution report message which can be passed to ShowMessage.

Note!
This method can only be used in the public section of the site!

Parameters

ParameterDescription
email E-mail of a new user (at least 3 symbols). E-mail is the subject of verification by the function check_email.
site_id ID of the site whose e-mail template is to be used for the notification dispatch (NEW_USER, USER_INFO etc.).
Optional. The current site is used by default.

See Also

Example



<?
global $USER;
$arResult = $USER->SimpleRegister("admin@mysite.com");
ShowMessage($arResult); // display result as a message
echo $USER->GetID(); // ID of a new user
?>