The solution is from the issue:
logintoboggan module allows to register & login with email. user_registrationpassword module allows to set password and emai validation both configuration. But it does NOT work for both modules together.
Solution:
-
Enabled user_registrationpassword;
-
Abandon logintoboggan, instead, implement email login with the following:
function bmisc_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'user_login') { array_unshift($form['#validate'], 'bmisc_email_login_user_login_validate'); } } /**
- Capture the username entered, if there is an @ symbol, it will check it against email addresses instead of the username
- if multiple_email is installed, check against that table instead
- @param array $form The current form (I guess...)
- @param array $form_state The state of the form (I guess...) */ function bmisc_email_login_user_login_validate($form, &$form_state) { if (isset($form_state['values']['name']) && strpos($form_state['values']['name'], '@') !== false) { $name = db_query("SELECT name FROM {users} WHERE LCASE(mail) = LCASE(:email)", array(":email" => $form_state['values']['name']))->fetchField(); if ($name) { form_set_value($form['name'], $name, $form_state); } } }
Reference: http://blog.seanja.com/2011/08/module-login-with-email-or-username-drupal/