You are here

function auto_username_form_user_profile_form_alter in Automatic User Names 7

Same name and namespace in other branches
  1. 8 auto_username.module \auto_username_form_user_profile_form_alter()

Implements hook_form_FORM_ID_alter().

File

./auto_username.module, line 49
Allows a user's username to be assigned based on tokens.

Code

function auto_username_form_user_profile_form_alter(&$form, &$form_state, $form_id) {

  // Only if there is a 'name' field present in the form, set it to hidden.
  if (isset($form['account']['name'])) {
    $form['account']['name']['#type'] = 'hidden';
  }
}