Commit ceac58ae authored by pcambra's avatar pcambra Committed by greggles

Issue #1291908 by pcambra, greggles: Keep the email login entered by the user...

Issue #1291908 by pcambra, greggles: Keep the email login entered by the user so it can be validated
parent b7f9d646
......@@ -100,6 +100,8 @@ function email_registration_form_user_login_block_alter(&$form, &$form_state) {
*/
function email_registration_user_login_validate($form, &$form_state) {
if (isset($form_state['values']['name'])) {
// Keep the email value in form state for furher validation.
$form_state['values']['email'] = $form_state['values']['name'];
if ($name = db_query('SELECT name FROM {users} WHERE LOWER(mail) = LOWER(:name)', array(':name' => $form_state['values']['name']))->fetchField()) {
$form_state['values']['name'] = $name;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment