You are here

function profile_user_import_after_save in User Import 8

Same name and namespace in other branches
  1. 5.2 supported/profile.inc \profile_user_import_after_save()
  2. 5 supported/profile.inc \profile_user_import_after_save()
  3. 6.4 supported/profile.inc \profile_user_import_after_save()
  4. 6.2 supported/profile.inc \profile_user_import_after_save()
  5. 7 supported/profile.inc \profile_user_import_after_save()
  6. 7.2 supported/profile.inc \profile_user_import_after_save()

Implementation of hook_user_import_after_save().

File

supported/profile.inc, line 36

Code

function profile_user_import_after_save($settings, $account, $password, $fields, $updated, $update_setting_per_module) {

  // get all fields
  $profile_fields = profile_get_fields();
  $data = $old_data = unserialize($account->data);
  foreach ($profile_fields as $field) {
    profile_user_import_save_profile($field, $account->uid, $fields['profile'][$field->fid][0], $updated, $update_setting_per_module['profile'], $data);
  }

  // data column in the user table needs to be updated
  if ($data != $old_data) {
    db_update('users')
      ->fields(array(
      'data' => serialize($data),
    ))
      ->condition('uid', $account->uid)
      ->execute();
  }
  return;
}