You are here

function user_badges_user_update in User Badges 7.3

Implementation of hook_user_update(). Will save the roles for a particular user each time that user is updated.

File

./user_badges.module, line 1163
@brief User Badges module file

Code

function user_badges_user_update(&$edit, $account, $category) {
  $roles = array();

  //Call the following function to get the roles for these rids
  if (isset($account->roles) && count($account->roles)) {
    $roles = user_badges_get_roles($account->roles);
  }

  //Now, call the following function to save the roles for this user
  user_badges_save_roles_for_uid($account->uid, $roles);
}