You are here

function twitter_account_form_submit in Twitter 6.3

Same name and namespace in other branches
  1. 6.4 twitter.pages.inc \twitter_account_form_submit()
  2. 7.3 twitter.pages.inc \twitter_account_form_submit()
  3. 7.4 twitter.pages.inc \twitter_account_form_submit()

Implements hook_FORM_ID_submit()

Loads Twitter account details and adds them to the user account

File

./twitter.pages.inc, line 305

Code

function twitter_account_form_submit($form, &$form_state) {
  module_load_include('inc', 'twitter');
  $name = $form_state['values']['screen_name'];
  $twitter = new Twitter($name);
  $account = $twitter
    ->users_show($name, false);
  twitter_account_save($account, TRUE, user_load($form_state['values']['uid']));
}