user_pass_validate

Definition

user_pass_validate()
modules/user.module, line 1055

Code

<?php
function user_pass_validate() {
  global $form_values;

  $name = $form_values['name'];
  $mail = $form_values['mail'];
  if ($name && !($form_values['account'] = user_load(array('name' => $name, 'status' => 1)))) {
    form_set_error('name', t('Sorry. The username %name is not recognized.', array('%name' => theme('placeholder', $name))));
  }
  else if ($mail && !($form_values['account'] = user_load(array('mail' => $mail, 'status' => 1)))) {
    form_set_error('mail', t('Sorry. The e-mail address %email is not recognized.', array('%email' => theme('placeholder', $mail))));
  }
  else if (!$mail && !$name) {
    form_set_error('password', t('You must provide either a username or e-mail address.'));
  }
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.