As I posted here, it is also possible to have this check on the edit username field if your permissions allows for it by adding the following to .module file. However, it doesnt do any extra checks (such as not including the existing username in the check) so it will display a "username exists" error if you choose the same username as you have already (after doing a backspace and then re-entering the same character for example). This is not a major problem for me as the page will still save even with the error in this case as you will not have really made any changes.

  function username_check_form_user_profile_form_alter(&$form)
  {
    _username_check_load_resources();

    $form['account']['name']['#field_suffix'] = '<span id="username-check-informer">&nbsp;</span>';
    $form['account']['name']['#suffix'] = '<div id="username-check-message"></div>';
  }

Comments

drupalina’s picture

So why not add an additional statement that IF the username entered is that of the current user, then display nothing.

(I would love to see this kind of functionality added.)

drnikki’s picture

StatusFileSize
new1.09 KB

Attached is a patch that checks logged in user's name & includes that code in the .module file.

drnikki’s picture

StatusFileSize
new1.38 KB

Sorry, without the new line.

darrellduane’s picture

I've incorporated the requested changes here with my patch for handling the email address checking at https://drupal.org/node/764332#comment-7508191

darrellduane’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.