You are here

function handle_page_three_submit in Google Authenticator / 2 Factor Authentication - 2FA 7

1 call to handle_page_three_submit()
mo_auth_inline_registration_submit in ./mo_auth_inline_registration.inc

File

./mo_auth_inline_registration.inc, line 660

Code

function handle_page_three_submit($form, &$form_state) {
  $form_state["rebuild"] = TRUE;

  // Added
  if (!isset($form_state['storage']['page_one_values'])) {
    global $user;
    $currentUser = user_load($user->uid);
    $form_state['storage']['page_one_values']['mo_auth_user_email'] = $currentUser->miniorange_registered_email['und'][0]['value'];
    $form_state['storage']['page_one_values']['mo_2fa_new_user'] = FALSE;
    $form_state['storage']['page_one_values']['mo_2fa_reset'] = TRUE;
    $form_state['storage']['page_two_values'] = array();
  }
  $method = $form['mo_auth_method']['#value'];
  if ($method == AuthenticationType::$EMAIL_VERIFICATION['code'] || $method == AuthenticationType::$EMAIL['code']) {

    // Go to Step 5 directly
    $form_state['storage']['page_five'] = TRUE;
    $form_state['storage']['page_three_values'] = $form_state['values'];
  }
  else {
    $form_state['storage']['page_four'] = TRUE;
    $form_state['storage']['page_three_values'] = $form_state['values'];
  }
}