You are here

function email_registration_form_user_admin_settings_alter in Email Registration 7

Same name and namespace in other branches
  1. 8 email_registration.module \email_registration_form_user_admin_settings_alter()

Implements hook_form_FORM_ID_alter().

File

./email_registration.module, line 173
Allows users to register with an e-mail address as their username.

Code

function email_registration_form_user_admin_settings_alter(&$form, &$form_state) {
  $form['registration_cancellation']['email_registration_login_with_username'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow users login with e-mail or username.'),
    '#description' => t('Allow users to login with their username in addition to their e-mail.'),
    '#default_value' => variable_get('email_registration_login_with_username', TRUE),
  );
  $form['registration_cancellation']['email_registration_email_field'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use HTML5 email field.'),
    '#description' => t('Modify the user register, login and forgot password textfields to an HTML5 type="email" field.'),
    '#default_value' => variable_get('email_registration_email_field', FALSE),
    '#access' => module_exists('elements'),
    '#states' => array(
      'invisible' => array(
        ':input[name="email_registration_login_with_username"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );
  $form['#submit'][] = 'email_registration_form_user_admin_settings_submit';
}