You are here

function _oauthconnector_info in OAuth Connector 6

Same name and namespace in other branches
  1. 7 oauthconnector.module \_oauthconnector_info()

Information callback

1 string reference to '_oauthconnector_info'
oauthconnector_connector in ./oauthconnector.module
Implementation of hook_connector().

File

./oauthconnector.module, line 332
OAuth Connector module

Code

function _oauthconnector_info($connector, $cid, $types) {
  if (!empty($types) && empty($types['real name'])) {
    return FALSE;
  }
  $info = array();
  $provider = $connector['oauthconnector provider'];
  if (!empty($provider->mapping['fields']['real name']['resource'])) {
    $token = oauthconnector_get_connection_token($connector['oauthconnector provider'], $cid);
    $real_name = _oauthconnector_fetch_field('real name', $provider, $token);

    //TODO: If $real_name is false - shouldn't we return that to trigger ther backing of mechanism?
    if ($real_name) {
      $info = array(
        'real name' => $real_name,
      );
    }
  }
  return $info;
}