event_handler( array &arFields );
The OnAfterUserRegister event fires after an attempt of a new user registration by calling the method CUser::Register.
Parameter | Description |
---|---|
arFields | Array of new user registration fields:
|
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/modules/my_module_id/include.php class MyClass { // OnAfterUserRegister handler function OnAfterUserRegisterHandler(&$arFields) { // if auth succeeds... if($arFields["USER_ID"]>0) { // if the current site is r1... if(SITE_ID=="r1") { // set the message which confirms // the registration within site r1 $arFields["RESULT_MESSAGE"]["MESSAGE"] = "You have successfully registered " "with site \"My site 1\""; } elseif(SITE_ID=="r2") { // set the message which confirms // the registration within site r1 $arFields["RESULT_MESSAGE"]["MESSAGE"] = "You have successfully registered " "with site \"My site 2\""; } } } } ?>
<? // register the OnAfterUserRegister handler RegisterModuleDependences("main", "OnAfterUserRegister", "my_module_id", "MyClass", "OnAfterUserRegisterHandler"); ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |