You are here

function logintoboggan_user_login_validate in LoginToboggan 6

Same name and namespace in other branches
  1. 8 logintoboggan.module \logintoboggan_user_login_validate()
  2. 5 logintoboggan.module \logintoboggan_user_login_validate()
  3. 7 logintoboggan.module \logintoboggan_user_login_validate()

Custom validation for user login form

1 string reference to 'logintoboggan_user_login_validate'
logintoboggan_form_alter in ./logintoboggan.module
Implementation of hook_form_alter()

File

./logintoboggan.module, line 415
Logintoboggan Module

Code

function logintoboggan_user_login_validate($form, &$form_state) {
  if (isset($form_state['values']['name']) && $form_state['values']['name']) {
    if ($name = db_result(db_query("SELECT name FROM {users} WHERE LOWER(mail) = LOWER('%s')", $form_state['values']['name']))) {
      form_set_value($form['name'], $name, $form_state);
    }
  }
}