You are here

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

Same name and namespace in other branches
  1. 8.2 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 316

Class

miniorange_2fa_inline_registration

Namespace

Drupal\miniorange_2fa\form

Code

function mo_auth_inline_registration_page_three(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
  $prefix = '<div class="mo2f-modal">
            <div class="mo2f-modal-content">
              <div class="mo2f-modal-container mo2f-modal-header">Select
  		      Authentication method (Step 3/5)</div>
              <div class="mo2f-modal-container">
		<div class="mo2f-info">Select your authentication method:</div><div>';
  $suffix = '</div></div><div class="mo2f-modal-container mo2f-modal-footer">';
  $options = array(
    AuthenticationType::$EMAIL_VERIFICATION['code'] => AuthenticationType::$EMAIL_VERIFICATION['name'],
    AuthenticationType::$GOOGLE_AUTHENTICATOR['code'] => AuthenticationType::$GOOGLE_AUTHENTICATOR['name'],
    AuthenticationType::$QR_CODE['code'] => AuthenticationType::$QR_CODE['name'],
    AuthenticationType::$KBA['code'] => AuthenticationType::$KBA['name'],
    AuthenticationType::$SOFT_TOKEN['code'] => AuthenticationType::$SOFT_TOKEN['name'],
    AuthenticationType::$PUSH_NOTIFICATIONS['code'] => AuthenticationType::$PUSH_NOTIFICATIONS['name'],
    AuthenticationType::$SMS['code'] => AuthenticationType::$SMS['name'],
    AuthenticationType::$SMS_AND_EMAIL['code'] => AuthenticationType::$SMS_AND_EMAIL['name'],
    AuthenticationType::$EMAIL['code'] => AuthenticationType::$EMAIL['name'],
    AuthenticationType::$OTP_OVER_PHONE['code'] => AuthenticationType::$OTP_OVER_PHONE['name'],
  );
  $form['mo_auth_method'] = array(
    '#type' => 'radios',
    '#default_value' => AuthenticationType::$EMAIL_VERIFICATION['code'],
    '#options' => $options,
    '#required' => TRUE,
    '#prefix' => $prefix,
    '#suffix' => $suffix,
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Next'),
    '#submit' => array(
      '::handle_page_three_submit',
    ),
  );
  $form['actions']['cancel'] = array(
    '#type' => 'submit',
    '#value' => t('Cancel'),
    '#submit' => array(
      '::handle_page_cancel',
    ),
  );
  return $form;
}