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

monstrfolk created an issue. See original summary.

sgerbino’s picture

If you create a pull request on GitHub I'll merge it in to 7.x dev for testing

https://github.com/sgerbino/realname_registration

monstrfolk’s picture

Sorry. Forked and created a pull request. Did not understand what you met.

monstrfolk’s picture

Status: Active » Needs review
sgerbino’s picture

sgerbino’s picture

Status: Needs review » Closed (fixed)