function user_pass_validate
Same name and namespace in other branches
- 7.x drupal-7.x/modules/user/user.pages.inc \user_pass_validate()
Archivo
- drupal-6.x/modules/user/user.pages.inc, line 43
- User page callback file for the user module.
Código
function user_pass_validate($form, &$form_state) {
$name = trim($form_state['values']['name']);
$account = user_load(array('mail' => $name, 'status' => 1));
if (!$account) {
$account = user_load(array('name' => $name, 'status' => 1));
}
if ($account) {
if (drupal_is_denied('user', $account->name) || drupal_is_denied('mail', $account->mail)) {
form_set_error('name', t('%name is not allowed to request a new password.', array('%name' => $name)));
}
}
if (isset($account->uid)) {
form_set_value(array('#parents' => array('account')), $account, $form_state);
}
else {
form_set_error('name', t('Sorry, %name is not recognized as a user name or an e-mail address.', array('%name' => $name)));
}
}