You are here

function linkedin_auth_register_form_submit in LinkedIn Integration 7

Same name and namespace in other branches
  1. 6 linkedin_auth/linkedin_auth.pages.inc \linkedin_auth_register_form_submit()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 string reference to 'linkedin_auth_register_form_submit'
linkedin_auth_form_alter in linkedin_auth/linkedin_auth.module
Implements hook_form_alter : adds LinkedIn login to the login forms().

File

linkedin_auth/linkedin_auth.module, line 150
Implement LinkedIn Authentication service for user login

Code

function linkedin_auth_register_form_submit($form, &$form_state) {
  user_external_login_register($form_state['values']['name'], 'linkedin');
  global $user;
  $account = user_save($user, $form_state['values']);
  if (!$account) {
    drupal_set_message(t("Error saving user account."), 'error');
    drupal_goto();
  }
  linkedin_access_token($account);

  //Unset variables no longer needed.
  unset($_SESSION['random']);
  unset($_SESSION['oauth_token_secret']);
  unset($_SESSION['linkedin_auth_register_bypass']);
}