You are here

function profile_user_import_after_save in User Import 6.4

Same name and namespace in other branches
  1. 8 supported/profile.inc \profile_user_import_after_save()
  2. 5.2 supported/profile.inc \profile_user_import_after_save()
  3. 5 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 33

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_query("UPDATE {users} SET data = '%s' WHERE uid = %d", serialize($data), $account->uid);
  }
  return;
}