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

cyberwolf’s picture

function emaiLregistration_menu_alter(&$items) {

should have been:

function email_registration_menu_alter(&$items) {
YK85’s picture

Status: Active » Needs review
thepanz’s picture

Only 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

technikh’s picture

+1 for Drupal 7 version

greggles’s picture

Status: Needs review » Needs work

Thanks for your bug report and for helping make this a better module. Could you provide this as a patch?

greggles’s picture

Status: Needs work » Closed (outdated)

Email 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.