You are here

function drupagram_account_form_submit in Drupagram 6

Same name and namespace in other branches
  1. 7 drupagram.pages.inc \drupagram_account_form_submit()

Implements hook_FORM_ID_submit()

Loads Instagram account details and adds them to the user account

File

./drupagram.pages.inc, line 182
Provieds drupagram forms.

Code

function drupagram_account_form_submit($form, &$form_state) {
  module_load_include('lib.php', 'drupagram');
  module_load_include('inc', 'drupagram');
  $name = $form_state['values']['username'];
  $drupagram = new Instagram($name);
  $account = $drupagram
    ->user_info($name);
  drupagram_account_save($account, TRUE, user_load($form_state['values']['uid']));
}