You are here

public function OAuth2HTTPSFetcher::sourceForm in Feeds OAuth 6

Expose source form.

Overrides FeedsHTTPFetcher::sourceForm

File

./OAuth2HTTPSFetcher.inc, line 140

Class

OAuth2HTTPSFetcher
Support OAuth 2.0 authentication.

Code

public function sourceForm($source_config) {
  $form = parent::sourceForm($source_config);
  global $user;
  $access_tokens = call_user_func($this->config['authenticator'], $user->uid, $this->config['site_id']);
  if (empty($access_tokens) && !empty($this->config['site_id'])) {
    drupal_set_message(t('Could not find OAuth access tokens for site %site. You should probably <a href="@url">authenticate first</a> to access protected information.', array(
      '%site' => $this->config['site_id'],
      '@url' => url('feeds/oauth2/authenticate/' . $this->id),
    )), 'warning', FALSE);
  }
  return $form;
}