You are here

function twilio_user_settings_add_form_submit in Twilio 7

Submit handler for user settings form.

@todo Please document this function.

See also

http://drupal.org/node/1354

1 string reference to 'twilio_user_settings_add_form_submit'
twilio_user_settings_form in ./twilio.pages.inc
User settings form.

File

./twilio.pages.inc, line 144
User facing pages

Code

function twilio_user_settings_add_form_submit($form, &$form_state, $account = NULL) {
  if (!$account) {
    $account = user_load($form_state['values']['uid']);
  }
  $account = twilio_user_send_confirmation($account, $form_state['values']['number'], $form_state['values']['countrycode']);
  $form_state['values']['account'] = $account;
  $form_state['rebuild'] = TRUE;
  drupal_set_message(t("A confirmation code has been sent to your mobile device"), 'status');
}