You are here

function gathercontent_login_form_submit in GatherContent 7.2

Form submission handler for gathercontent_login_form().

File

includes/login.inc, line 41
Page for inputting GatherContent authentication settings.

Code

function gathercontent_login_form_submit($form, &$form_state) {
  $obj = gathercontent_get_obj();
  $ret = $obj
    ->get('get_me', array(), $form_state['values']['gathercontent_api_url'], $form_state['values']['gathercontent_api_key']);
  variable_set('gathercontent_api_url', $form_state['values']['gathercontent_api_url']);
  variable_set('gathercontent_api_key', $form_state['values']['gathercontent_api_key']);
  if ($ret === FALSE) {
    drupal_set_message($obj->error, 'error');
  }
  else {
    drupal_goto('admin/config/content/gathercontent');
  }
}