You are here

function hybridauth_get_connected_providers in HybridAuth Social Login 6.2

Same name and namespace in other branches
  1. 7.2 hybridauth.module \hybridauth_get_connected_providers()

Returns connected providers for the current user.

1 call to hybridauth_get_connected_providers()
hybridauth_user_identity in ./hybridauth.pages.inc
Menu callback; manage HybridAuth identities for the specified user.

File

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

Code

function hybridauth_get_connected_providers() {
  $connected_providers = array();
  if (user_is_logged_in() && ($hybridauth = hybridauth_get_instance())) {
    try {
      foreach ($hybridauth
        ->getConnectedProviders() as $provider_id) {
        $connected_providers[$provider_id] = hybridauth_get_provider_name($provider_id);
      }
    } catch (Exception $e) {

      //watchdog_exception('hybridauth', $e);
      watchdog('hybridauth', $e
        ->getMessage(), array(), WATCHDOG_ERROR);
    }
  }
  return $connected_providers;
}