You are here

public function TfaTotp::getForm in TFA Basic plugins 7

@copydoc TfaValidationPluginInterface::getForm()

Overrides TfaValidationPluginInterface::getForm

1 call to TfaTotp::getForm()
TfaTotpSetup::getSetupForm in includes/tfa_totp.inc
@copydoc TfaSetupPluginInterface::getSetupForm()

File

includes/tfa_totp.inc, line 50
classes for tfa_totp

Class

TfaTotp
Class TfaTotp

Code

public function getForm(array $form, array &$form_state) {
  $form['code'] = array(
    '#type' => 'textfield',
    '#title' => t('Application verification code'),
    '#description' => t('Verification code is application generated and !length digits long.', array(
      '!length' => $this->codeLength,
    )),
    '#required' => TRUE,
    '#attributes' => array(
      'autocomplete' => 'off',
    ),
  );
  if (module_exists('elements')) {
    $form['code']['#type'] = 'numberfield';
  }
  $form['actions']['#type'] = 'actions';
  $form['actions']['login'] = array(
    '#type' => 'submit',
    '#value' => t('Verify'),
  );
  return $form;
}