You are here

function salesforce_oauth_form_submit in Salesforce Suite 7.3

Submit handler for salesforce_oauth_form().

Parameters

array $form: The form array.

array $form_state: The form state array.

File

./salesforce.module, line 251
API and module for Salesforce integration.

Code

function salesforce_oauth_form_submit($form, &$form_state) {
  $consumer_key = $form_state['values']['salesforce_consumer_key'];
  $consumer_secret = $form_state['values']['salesforce_consumer_secret'];
  $salesforce_endpoint = empty($form_state['values']['salesforce_endpoint']) ? SALESFORCE_DEFAULT_ENDPOINT : $form_state['values']['salesforce_endpoint'];
  variable_set('salesforce_consumer_key', $consumer_key);
  variable_set('salesforce_consumer_secret', $consumer_secret);
  variable_set('salesforce_endpoint', $salesforce_endpoint);
  $salesforce = new Salesforce($consumer_key, $consumer_secret);
  $salesforce
    ->getAuthorizationCode();
}