How to alter Core's user login final function In user.module, I need to alter the message that is displayed if the username/password is not recognized. I'm using the email registration module so I don't use usernames at all. I want the last form error message in the code below to show email/password instead, as well as add a custom redirect to it.  

I've googled for quite some time, but cannot find how to hook onto this function. Any help would be appreciated!

function user_login_final_validate($form, &amp;$form_state) { 
  if (empty($form_state['uid'])) {
  // Always register an IP-based failed login event.
  flood_register_event('failed_login_attempt_ip', variable_get('user_failed_login_ip_window', 3600));
  // Register a per-user failed login event.
  if (isset($form_state['flood_control_user_identifier'])) {
  flood_register_event('failed_login_attempt_user', variable_get('user_failed_login_user_window', 21600), $form_state['flood_control_user_identifier']);
}

if (isset($form_state['flood_control_triggered'])) {
  if ($form_state['flood_control_triggered'] == 'user') {
    form_set_error('name', format_plural(variable_get('user_failed_login_user_limit', 5), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or &lt;a href="@url"&gt;request a new password&lt;/a&gt;.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or &lt;a href="@url"&gt;request a new password&lt;/a&gt;.', array('@url' =&gt; url('user/password'))));
  }
  else {
    // We did not find a uid, so the limit is IP-based.
    form_set_error('name', t('Sorry, too many failed login attempts from your IP address. This IP address is temporarily blocked. Try again later or &lt;a href="@url"&gt;request a new password&lt;/a&gt;.', array('@url' =&gt; url('user/password'))));
  }
}
else {
  // Fix password reset messages
  form_set_error('name', t('Sorry, unrecognized username or password. &lt;a href="@password"&gt;Have you forgotten your password?&lt;/a&gt;', array('@password' =&gt; url('user/password', array('query' =&gt; array('name' =&gt; $form_state['values']['name']))))));
  watchdog('user', 'Login attempt failed for %user.', array('%user' =&gt; $form_state['values']['name']));
}


}
Override login form with hook_form_alter()

You need to replace validation function with your custom function.