Documentation

LoginByHash

mixed 
   CUser::LoginByHash(
string login,
string hash
)

The method verifies the login and a password hash string and performs or declines the user authorization depending on the verification result. Returns true on successful authorization. In case the authorization failed, the method returns the error description array that can be passed to ShowMessage function. Non-static method.

Parameters

ParameterDescription
login User login.
cookie_hash Special hash for the user password.

See Also

Examples of use

<?
global $USER;
if (!is_object($USER)) $USER = new CUser;
$cookie_login = ${COption::GetOptionString("main", "cookie_name", "BITRIX_SM")."_LOGIN"};
$cookie_md5pass = ${COption::GetOptionString("main", "cookie_name", "BITRIX_SM")."_UIDH"};
$USER->LoginByHash($cookie_login, $cookie_md5pass);
?>


© «Bitrix24», 2001-2024
Up