function user_user_import_data in User Import 8
Same name and namespace in other branches
- 5.2 supported/user.inc \user_user_import_data()
- 5 supported/user.inc \user_user_import_data()
- 6.4 supported/user.inc \user_user_import_data()
- 6.2 supported/user.inc \user_user_import_data()
- 7.3 supported/user.inc \user_user_import_data()
- 7 supported/user.inc \user_user_import_data()
- 7.2 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_numerric($timestamp)) {
$value = $timestamp;
}
}
}
if ($field_id == 'roles') {
$value = user_user_import_roles_data($data[$column_id], $settings['roles_new']);
}
return $value;
}