function system_mfa_login_form_validate

6.x system.module system_mfa_login_form_validate($form, $form_state)

File

modules/system/system.module, line 3242

Code

function system_mfa_login_form_validate($form, $form_state) {

  $db_row = $_SESSION ['mfa__form_state_db_row'];

  $user_id = $db_row ['user_id'];

  // Validate the code.
  $db_code = user_get_attribute($user_id, "mfa_validation_code", FALSE);


  if (intval($form_state ['values']['mfa_code']) !== intval($db_code)) {
    form_error('mfa_code', t("Sorry, but the code you entered is not the same that was sent to your address.  Try again.  If you are unable to log in, have a systems
                              administrator reset your password."));
    return;
  }



}