1 user.pages.inc user_pass_reset_form($form, &$form_state, $account)

Form builder; one time login form with password reset.

See also

user_pass_reset_form_submit()

Related topics

File

core/modules/user/user.pages.inc, line 184
User page callback file for the user module.

Code

function user_pass_reset_form($form, &$form_state, $account) {
  $form['#account'] = $account;
  $description = '';
  module_load_include('password.inc', 'user', 'user');
  $reject_weak = user_password_reject_weak($account->name);
  if ($reject_weak) {
    $form['#validate'][] = 'user_password_policy_validate';
    $description = _user_password_policy_help();
  }
  $form['message'] = array(
    '#markup' => t('<p>Please enter a new password to access your account.</p>'),
  );
  $form['pass'] = array(
    '#type' => 'password_confirm',
    '#required' => TRUE,
    '#description' => $description,
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save password & log in'),
  );

  return $form;
}