You are here

function email_registration_user_login_validate in Email Registration 5

Same name and namespace in other branches
  1. 8 email_registration.module \email_registration_user_login_validate()
  2. 6 email_registration.module \email_registration_user_login_validate()
  3. 7 email_registration.module \email_registration_user_login_validate()

Custom validation function for user login form. Allows users to authenticate by email only, which is our preferred method.

File

./email_registration.module, line 95

Code

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