public function TfaTestSendSetup::submitSetupForm in Two-factor Authentication (TFA) 7.2
Submit setup form.
Parameters
array $form: The form array structure.
array $form_state: The current form state array.
Return value
bool Indicates whether the form submission succeeded.
Overrides TfaSetupPluginInterface::submitSetupForm
File
- tests/
includes/ tfa_test.send.inc, line 160 - Tests for the TfaSendPluginInterface.
Class
- TfaTestSendSetup
- Class TfaTestSendSetup.
Code
public function submitSetupForm(array $form, array &$form_state) {
if (!empty($form_state['values']['location'])) {
// Code would be sent to $form_state['values']['location'].
$form_state['storage']['location'] = $form_state['values']['location'];
return FALSE;
}
else {
// Replace test code.
variable_set('tfa_test_code', $form_state['storage']['location']);
// Location would be saved.
return TRUE;
}
}