You are here

function tfa_basic_form_submit in TFA Basic plugins 7

Submit for TFA admin settings alter.

1 string reference to 'tfa_basic_form_submit'
tfa_basic_form_tfa_admin_settings_alter in ./tfa_basic.module
Implements hook_form_FORM_ID_alter().

File

./tfa_basic.module, line 710

Code

function tfa_basic_form_submit($form, &$form_state) {
  if (!empty($form_state['values']['tfa_basic_cookie_domain'])) {
    variable_set('tfa_basic_cookie_domain', $form_state['values']['tfa_basic_cookie_domain']);
  }
  if (!empty($form_state['values']['tfa_basic_twilio_account_sid'])) {
    variable_set('tfa_basic_twilio_account_sid', $form_state['values']['tfa_basic_twilio_account_sid']);
  }
  if (!empty($form_state['values']['tfa_basic_twilio_account_token'])) {
    variable_set('tfa_basic_twilio_account_token', $form_state['values']['tfa_basic_twilio_account_token']);
  }
  if (!empty($form_state['values']['tfa_basic_twilio_account_number'])) {
    variable_set('tfa_basic_twilio_account_number', $form_state['values']['tfa_basic_twilio_account_number']);
  }
  if (!empty($form_state['values']['tfa_basic_twilio_message_text'])) {
    variable_set('tfa_basic_twilio_message_text', $form_state['values']['tfa_basic_twilio_message_text']);
  }
  if (isset($form_state['values']['tfa_basic_sms_nanp_validate'])) {
    variable_set('tfa_basic_sms_nanp_validate', $form_state['values']['tfa_basic_sms_nanp_validate']);
  }
  if (!empty($form_state['values']['tfa_basic_help_text'])) {
    variable_set('tfa_basic_help_text', $form_state['values']['tfa_basic_help_text']);
  }
  $phone_field = variable_get('tfa_basic_phone_field', '');
  if ($phone_field !== FALSE && !empty($form_state['values']['tfa_fallback']) && !empty($form_state['values']['tfa_fallback']['tfa_basic_sms']['enable']) && !empty($form_state['values']['tfa_basic_phone_field'])) {
    variable_set('tfa_basic_phone_field', $form_state['values']['tfa_basic_phone_field']);
  }
  variable_set('tfa_basic_roles_require', $form_state['values']['required_tfa_roles']);
}