You are here

function simple_ldap_user_login_name_validate in Simple LDAP 7.2

Same name and namespace in other branches
  1. 7 simple_ldap_user/simple_ldap_user.module \simple_ldap_user_login_name_validate()

Validate the username on a login or password reset form.

1 string reference to 'simple_ldap_user_login_name_validate'
simple_ldap_user_form_alter in simple_ldap_user/simple_ldap_user.module
Implements hook_form_alter().

File

simple_ldap_user/simple_ldap_user.module, line 625
Main simple_ldap_user module file.

Code

function simple_ldap_user_login_name_validate($form, &$form_state) {

  // Get the username from the form data.
  $name = trim($form_state['values']['name']);
  if (simple_ldap_user_load_or_create_by_name($name) === NULL) {
    form_set_error('name', t('An account ID conflict has been detected.  Please contact your site administrator.'));
  }
}