You are here

public function TfaBasicRecoveryCode::getForm in TFA Basic plugins 7

@copydoc TfaBasePlugin::getForm()

Overrides TfaValidationPluginInterface::getForm

File

includes/tfa_recovery.inc, line 34
class for TFA Basic

Class

TfaBasicRecoveryCode
Class TfaBasicRecoveryCode

Code

public function getForm(array $form, array &$form_state) {
  $form['recover'] = array(
    '#type' => 'textfield',
    '#title' => t('Enter one of your recovery codes'),
    '#required' => TRUE,
    '#description' => t('Recovery codes were generated when you first set up TFA. Format: XXX XX XXX'),
    '#attributes' => array(
      'autocomplete' => 'off',
    ),
  );
  if (module_exists('elements')) {
    $form['recover']['#type'] = 'numberfield';
  }
  $form['actions']['#type'] = 'actions';
  $form['actions']['login'] = array(
    '#type' => 'submit',
    '#value' => t('Verify'),
  );
  return $form;
}