You are here

function user_email_verification_request in User email verification 7

Form builder; Request a email verification.

See also

user_email_verification_request_validate()

user_email_verification_request_submit()

1 string reference to 'user_email_verification_request'
user_email_verification_menu in ./user_email_verification.module
Implements hook_menu().

File

./user_email_verification.admin.inc, line 141
Administrative functions required in a specific case.

Code

function user_email_verification_request() {
  global $user;
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Username or e-mail address'),
    '#size' => 60,
    '#maxlength' => max(USERNAME_MAX_LENGTH, EMAIL_MAX_LENGTH),
    '#required' => TRUE,
    '#default_value' => isset($_GET['name']) ? $_GET['name'] : '',
  );

  // Allow logged in users to request this also.
  if ($user->uid > 0) {
    $form['name']['#type'] = 'value';
    $form['name']['#value'] = $user->mail;
    $form['mail'] = array(
      '#prefix' => '<p>',
      '#markup' => t('Verify email will be send to %email.', array(
        '%email' => $user->mail,
      )),
      '#suffix' => '</p>',
    );
  }
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Send verify mail'),
  );
  return $form;
}