You are here

function authenticate_user::mo_auth_build_push_notifications_form in Google Authenticator / 2 Factor Authentication - 2FA 8

Same name and namespace in other branches
  1. 8.2 src/Form/authenticate_user.php \Drupal\miniorange_2fa\form\authenticate_user::mo_auth_build_push_notifications_form()
1 call to authenticate_user::mo_auth_build_push_notifications_form()
authenticate_user::mo_auth_build_form_content in src/Form/authenticate_user.php

File

src/Form/authenticate_user.php, line 466
This is used to authenticate user during login.

Class

authenticate_user
@file This is used to authenticate user during login.

Namespace

Drupal\miniorange_2fa\form

Code

function mo_auth_build_push_notifications_form($form, $base_url, $challenge_response) {
  $response = $_SESSION['mo_auth']['mo_challenge_response'];
  $message = 'Please accept the push notification sent to your miniOrange Authenticator App.';
  $form['header']['#markup'] .= t('<div class="mo2f-message mo2f-message-status">' . $message . '</div>');
  $form['header']['#markup'] .= t('<div class="mo2f-info mo2f-text-center">A Push Notification has been sent to your miniOrange Authenticator App.</div>
                  <div class="mo2f-info mo2f-text-center">We are waiting for your approval...</div>');
  $image_path = file_create_url($base_url . '/' . drupal_get_path('module', 'miniorange_2fa') . '/includes/images/ajax-loader-login.gif');
  $form['header']['#markup'] .= '<div class="mo2f-text-center"><img src="' . $image_path . '"></div>';
  $form['txId'] = array(
    '#type' => 'hidden',
    '#value' => $response->txId,
  );
  $form['url'] = array(
    '#type' => 'hidden',
    '#value' => MoAuthConstants::$AUTH_STATUS_API,
  );
  $form['mo_message'] = $message;
  return $form;
}