You are here

function drupagram_account_form_submit in Drupagram 7

Same name and namespace in other branches
  1. 6 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 297
Drupagram admin page callaback functions.

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']));
}