You are here

function miniorange_2fa_inline_registration::mo_auth_inline_registration_page_three in Google Authenticator / 2 Factor Authentication - 2FA 8.2

Same name and namespace in other branches
  1. 8 src/Form/miniorange_2fa_inline_registration.php \Drupal\miniorange_2fa\form\miniorange_2fa_inline_registration::mo_auth_inline_registration_page_three()
1 call to miniorange_2fa_inline_registration::mo_auth_inline_registration_page_three()
miniorange_2fa_inline_registration::buildForm in src/Form/miniorange_2fa_inline_registration.php
Form constructor.

File

src/Form/miniorange_2fa_inline_registration.php, line 385
Page 1: Select Email address. Page 2: Verify OTP. Page 3: Select Auth Method. Page 4: Configure Auth Method. Page 5: Configure KBA.

Class

miniorange_2fa_inline_registration
@file Page 1: Select Email address. Page 2: Verify OTP. Page 3: Select Auth Method. Page 4: Configure Auth Method. Page 5: Configure KBA.

Namespace

Drupal\miniorange_2fa\form

Code

function mo_auth_inline_registration_page_three(array $form, FormStateInterface $form_state, $reset2FA = FALSE) {
  $heading = $reset2FA ? t('Select Authentication method') : t('Select Authentication method  (Step 3/5)');
  $prefix = '<div class="mo2f-modal">
            <div class="mo2f-modal-content">
              <div class="mo2f-modal-container mo2f-modal-header">' . $heading . '</div>
              <div class="mo2f-modal-container">
        <div class="mo2f-info">' . t('Select your authentication method:') . '</div><div>';
  $suffix = '</div></div><div class="mo2f-modal-container mo2f-modal-footer">';
  $options = MoAuthUtilities::get_2fa_methods_for_inline_registration(TRUE);
  $form['mo_auth_method'] = array(
    '#type' => 'select',
    '#default_value' => array_keys($options)[0],
    '#options' => $options,
    '#required' => TRUE,
    '#prefix' => $prefix,
    '#suffix' => $suffix,
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['next'] = array(
    '#type' => 'submit',
    '#value' => t('Next'),
    '#submit' => array(
      '::handle_page_three_submit',
    ),
    '#attributes' => array(
      'class' => array(
        'mo2f_button',
      ),
    ),
  );
  $form['actions']['cancel'] = array(
    '#type' => 'submit',
    '#value' => t('Cancel'),
    '#submit' => array(
      '::handle_page_cancel',
    ),
    '#attributes' => array(
      'class' => array(
        'mo2f_button',
      ),
    ),
  );
  return $form;
}