function user_login_name_validate

A FAPI validate handler. Sets an error if supplied username has been blocked.

1 string reference to 'user_login_name_validate'
user_login_default_validators in drupal/core/modules/user/user.module
Set up a series for validators which check for blocked users, then authenticate against local database, then return an error if authentication fails. Distributed authentication modules are welcome to use hook_form_alter() to change this series in…

File

drupal/core/modules/user/user.module, line 1224
Enables the user registration and login system.

Code

function user_login_name_validate($form, &$form_state) {
  if (!empty($form_state['values']['name']) && user_is_blocked($form_state['values']['name'])) {

    // Blocked in user administration.
    form_set_error('name', t('The username %name has not been activated or is blocked.', array(
      '%name' => $form_state['values']['name'],
    )));
  }
}