function user_user_import_data in User Import 7.3
Same name and namespace in other branches
- 8 supported/user.inc \user_user_import_data()
- 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 supported/user.inc \user_user_import_data()
- 7.2 supported/user.inc \user_user_import_data()
Implementation of hook_user_import_data().
Parameters
$settings:
$update_setting: TRUE if "Update existing users" is set to "Replace data" or "Update data" for at least one item.
$column_settings:
$module:
$field_id:
$colum_id:
File
- supported/
user.inc, line 63
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;
}