event_handler( array &arParams );
The OnAfterUserLoginByHash event is called from the method CUser::LoginByHash() after the verification of login arParams['LOGIN'] and a password hash arParams['HASH'], after the authorization attempt.
The field arParams['USER_ID'] contains the ID of a successfully authorized user. The array arParams['RESULT_MESSAGE']. contains the error description.
Parameter | Description |
---|---|
arParams | Array of fields used for user login and password verification, the following keys available:
|
Note
All parameters passed to this handler function are references to original variables. Therefore, all changes to parameters made within the handler affect values of the original variables.
For example, this allows to modify the RESULT_MESSAGE, which will change message returned by the method CUser::Login.
// file /bitrix/php_interface/init.php // register handler AddEventHandler("main", "OnAfterUserLoginByHash", Array("MyClass", "OnAfterUserLoginByHashHandler")); class MyClass { // create OnAfterUserLoginByHash handler function OnAfterUserLoginByHashHandler(&$arParams) { if ($arParams['USER_ID']<=0) { // redefine the error message. $arParams['RESULT_MESSAGE'] = Array("MESSAGE" => "New error.", "TYPE" => "ERROR"); } } } ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |