The title of several pages still equals the login name, which is IMHO quite confusing for end users. Instead, the e-mail address should be shown.
function emaiLregistration_menu_alter(&$items) {
$items['user/%user_uid_optional'] = array_merge($items['user/%user_uid_optional'], array(
'title' => 'My account',
'title callback' => 'email_registration_user_page_title',
'title arguments' => array(1),
));
$items['user/%user_category/edit']['page callback'] = 'email_registration_user_edit';
$empty_account = new stdClass();
if (($categories = _user_categories($empty_account)) && (count($categories) > 1)) {
foreach ($categories as $key => $category) {
// 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK.
if ($category['name'] != 'account') {
$items['user/%user_category/edit/'. $category['name']]['page callback'] = 'email_registration_user_edit';
}
}
}
return $items;
}
function email_registration_user_page_title($account) {
global $user;
if ($account->uid == $user->uid) {
return t('My account');
}
return $account->mail;
}
/**
* Replacement for user_edit page callback, which sets the user e-mail as title instead
* of the user account name
*/
function email_registration_user_edit($account, $category = 'account') {
drupal_set_title(check_plain($account->mail));
return drupal_get_form('user_profile_form', $account, $category);
Comments
Comment #1
cyberwolf commentedshould have been:
Comment #2
YK85 commentedComment #3
thepanz commentedOnly my 2cents: I think that your code could "broke/interfer" with RealName module (the last one edits user name display.. like Conten_profile does)...
Take my comment as a check-list for further module integration ;)
Regards
Comment #4
technikh commented+1 for Drupal 7 version
Comment #5
gregglesThanks for your bug report and for helping make this a better module. Could you provide this as a patch?
Comment #6
gregglesEmail Registration is no longer supported on 6.x-1.x. If you feel this issue is still relevant for 7.x or 8.x please reopen it.