You are here

function user_module_invoke in Drupal 7

Same name and namespace in other branches
  1. 4 modules/user.module \user_module_invoke()
  2. 5 modules/user/user.module \user_module_invoke()
  3. 6 modules/user/user.module \user_module_invoke()

Invokes a user hook in every module.

We cannot use module_invoke() for this, because the arguments need to be passed by reference.

Parameters

$type: A text string that controls which user hook to invoke. Valid choices are:

$edit: An associative array variable containing form values to be passed as the first parameter of the hook function.

$account: The user account object to be passed as the second parameter of the hook function.

$category: The category of user information being acted upon.

2 calls to user_module_invoke()
user_login_finalize in modules/user/user.module
Finalize the login process. Must be called when logging in a user.
user_save in modules/user/user.module
Save changes to a user account or add a new user.

File

modules/user/user.module, line 98
Enables the user registration and login system.

Code

function user_module_invoke($type, &$edit, $account, $category = NULL) {
  foreach (module_implements('user_' . $type) as $module) {
    $function = $module . '_user_' . $type;
    $function($edit, $account, $category);
  }
}