Please add case 10 - first name last initial
t('First name and last initial with spaces (e.g., John S)')
case 10:
// Create username based on first name and last initial (e.g., John S).
if (variable_get('realname_registration_use_profile2_firstname_field')) {
$username = $edit['profile_' . $firstname_type][$firstname_field][LANGUAGE_NONE][0]['value'];
}
else {
$username = $edit[$firstname_field][LANGUAGE_NONE][0]['value'];
}
if (variable_get('realname_registration_use_profile2_lastname_field')) {
$username .= ' ' . drupal_substr($edit['profile_' . $lastname_type][$lastname_field][LANGUAGE_NONE][0]['value'], 0, 1);
}
else {
$username .= ' ' . drupal_substr($edit[$lastname_field][LANGUAGE_NONE][0]['value'], 0, 1);
}
break;
Comments
Comment #2
sgerbino commentedIf you create a pull request on GitHub I'll merge it in to 7.x dev for testing
https://github.com/sgerbino/realname_registration
Comment #3
monstrfolk commentedSorry. Forked and created a pull request. Did not understand what you met.
Comment #4
monstrfolk commentedComment #5
sgerbino commentedMerged in this change under https://github.com/sgerbino/realname_registration/pull/6
Comment #6
sgerbino commented