OnAfterUserLoginByHash
handler function( array &arParams );The event "OnAfterUserLoginByHash" fires in the method CUser::LoginByHash() after verification of login arParams['LOGIN'], password cache arParams['HASH'] and user authorization attempt. The parameter arParams['USER_ID'] passes the ID of the user that was successfully authorized, as well as the array with error message arParams['RESULT_MESSAGE'].
Parameters
Parameter | Description |
---|---|
arParams | Array of fields for login verification and password:
|
Same 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.
It allows, for example, to update RESULT_MESSAGE, resulting in message update, returned by the function CUser::LoginByHash.
See Also
- "OnBeforeUserLoginByHash" event
- CUser::LoginByHash
- Events
- External Authorization
Example of handler function:
// file /bitrix/php_interface/init.php // register the handler AddEventHandler("main", "OnAfterUserLoginByHash", Array("MyClass", "OnAfterUserLoginByHashHandler"));
class MyClass { // create handler "OnAfterUserLoginByHash" public static function OnAfterUserLoginByHashHandler(&$arParams) { if($arParams['USER_ID']<=0) { //re-define the error message. $arParams['RESULT_MESSAGE'] = Array("MESSAGE" => "New error.", "TYPE" => "ERROR"); } } } ?>
© «Bitrix24», 2001-2023