You are here

function user_user_import_data in User Import 7.2

Same name and namespace in other branches
  1. 8 supported/user.inc \user_user_import_data()
  2. 5.2 supported/user.inc \user_user_import_data()
  3. 5 supported/user.inc \user_user_import_data()
  4. 6.4 supported/user.inc \user_user_import_data()
  5. 6.2 supported/user.inc \user_user_import_data()
  6. 7.3 supported/user.inc \user_user_import_data()
  7. 7 supported/user.inc \user_user_import_data()

Implementation of hook_user_import_data().

File

supported/user.inc, line 54

Code

function user_user_import_data($settings, $update_setting, $column_settings, $module, $field_id, $data, $column_id) {
  if ($module != 'user') {
    return;
  }
  if ($field_id == 'email') {
    $value = trim($data[$column_id]);
    if (!empty($settings['options']['email_domain'])) {
      $value .= $settings['options']['email_domain'];
    }
    _user_import_validate_email($value, $update_setting);
  }
  if ($field_id == 'password') {
    $value = trim($data[$column_id]);
  }
  if ($field_id == 'created') {
    $value = trim($data[$column_id]);
    if (!empty($value) && !is_numeric($value)) {
      $parsed = date_parse($value);
      $timestamp = mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $parsed['month'], $parsed['day'], $parsed['year']);
      if (!empty($timestamp) && is_numeric($timestamp)) {
        $value = $timestamp;
      }
    }
  }
  if ($field_id == 'roles') {
    $value = user_user_import_roles_data($data[$column_id], $settings['roles_new']);
  }
  return $value;
}