You are here

function hybridauth_get_provider_config in HybridAuth Social Login 6.2

Same name and namespace in other branches
  1. 7.2 hybridauth.module \hybridauth_get_provider_config()
  2. 7 hybridauth.auth.inc \hybridauth_get_provider_config()

Returns provider config.

2 calls to hybridauth_get_provider_config()
hybridauth_get_config in ./hybridauth.module
hybridauth_get_enabled_providers in ./hybridauth.module

File

./hybridauth.module, line 508
Main file for the HybridAuth module.

Code

function hybridauth_get_provider_config($provider_id, $enabled_only = TRUE) {
  $config = NULL;
  $enabled = variable_get('hybridauth_provider_' . $provider_id . '_enabled', 0);
  if (!$enabled_only || $enabled) {
    $config = array(
      'enabled' => $enabled,
      'keys' => array(
        'id' => trim(variable_get('hybridauth_provider_' . $provider_id . '_keys_id', '')),
        'key' => trim(variable_get('hybridauth_provider_' . $provider_id . '_keys_key', '')),
        'secret' => trim(variable_get('hybridauth_provider_' . $provider_id . '_keys_secret', '')),
      ),
      'scope' => variable_get('hybridauth_provider_' . $provider_id . '_scope', ''),
      'display' => variable_get('hybridauth_provider_' . $provider_id . '_display', 'popup'),
      'hauth_return_to' => url('hybridauth/endpoint'),
    );
    if (is_array($config['scope'])) {
      $config['scope'] = array_filter($config['scope']);
    }
  }
  return $config;
}