Bitrix Site Manager

OnAfterUserUpdate event

event_handler(
 array &arFields
);
The OnAfterUserUpdate event fires upon an attempt to modify a user properties by calling CUser::Update.

Parameters

ParameterDescription
arFields An array of fields describing the user whose information is to be updated. Additionally, the RESULT field contains the return value of CUser::Update. If the latter failed, the RESULT_MESSAGE field will contain the error description.

Note
All parameters passed to this handler function and the arParams array are references to original variables. Therefore, all changes to parameters made within the handler affect values of the original variables.

See Also

  • OnBeforeUserUpdate event
  • CUser::Update
  • Event handlers

    Example

    
    <?
    // file /bitrix/php_interface/init.php
    // register handler
    AddEventHandler("main", "OnAfterUserUpdate", Array("MyClass", "OnAfterUserUpdateHandler"));
    
    class MyClass
    {
        // create the OnAfterUserUpdate event handler
        function OnAfterUserUpdateHandler(&$arFields)
        {
            if($arFields["RESULT"])
                AddMessage2Log("Record with ID=".$arFields["ID"]." has been modified.");
            else
                AddMessage2Log("Error updating record ".$arFields["ID"]." (".$arFields["RESULT_MESSAGE"].").");
        }
    }
    ?>