Bitrix Site Manager

CUser::ChangePassword

array
CUser::ChangePassword(
 string login,
 string checkword,
 string new_password,
 string new_password_confirmation,
 string site_id = SITE_ID
)

The method ChangePassword modifies the user password and then calls CUser::SendUserInfo, which in its turn sends the e-mail message using the template USER_INFO. Returns an array containing the result message information. The array returned may be processed by ShowMessage further.

Parameters

ParameterDescription
login User login.
checkword Check string used to change the password.
new_password New password.
new_password_confirmation Password confirmation. For successful password change, it must be equal to new_password.
site_id The ID of the site containing the template USER_INFO used to send notification.
Optional. The current site is used by default.

See Also

Example



<?
global $USER;
$arResult = $USER->ChangePassword("admin", "WRD45GT", "123456", "123456");
if($arResult["TYPE"] == "OK") echo "Password successfully changed.";
else ShowMessage($arResult);
?>