public function TfaTestFallback::validateForm in Two-factor Authentication (TFA) 7.2
Validate form.
Parameters
array $form: The form array structure.
array $form_state: The current form state array.
Return value
bool Whether form passes validation or not.
Overrides TfaValidationPluginInterface::validateForm
File
- tests/
includes/ tfa_test.fallback.inc, line 40 - Tests for the TfaValidationPluginInterface.
Class
- TfaTestFallback
- Class TfaTestFallback.
Code
public function validateForm(array $form, array &$form_state) {
if (!parent::validate($form_state['values']['recover'])) {
$this->errorMessages['code'] = t('Invalid recovery code');
return FALSE;
}
else {
return TRUE;
}
}