You are here

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

1 string reference to 'mo_auth_configure_kba'
mo_auth_menu in ./mo_auth.module
Implements hook_menu().

File

./configure_kba.inc, line 3

Code

function mo_auth_configure_kba($form, &$form_state) {
  global $base_url, $user;
  $user = user_load($user->uid);
  $user_email = $user->miniorange_registered_email[LANGUAGE_NONE][0]['value'];
  $customer = new MiniorangeCustomerProfile();
  $miniorange_user = new MiniorangeUser($customer
    ->getCustomerID(), $user_email, NULL, NULL, AuthenticationType::$GOOGLE_AUTHENTICATOR['code']);
  $auth_api_handler = new AuthenticationAPIHandler($customer
    ->getCustomerID(), $customer
    ->getAPIKey());

  // $response = $auth_api_handler->getGoogleAuthSecret($miniorange_user);
  // $qrCode = $response->qrCodeData;
  // $secret = $response->secret;
  $form['header']['#markup'] = '<div class="mo2f-setup-header"><div class="mo2f-setup-header-top-left">Configure Security Questions (KBA)</div></div>' . mo_auth_create_form($base_url);
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['verifyphone'] = array(
    '#type' => 'verifyphone',
    '#value' => t('Verify'),
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  $form['actions']['cancel'] = array(
    '#markup' => l(t('Cancel'), 'admin/config/people/mo_auth/setup'),
  );
  return $form;
}