You are here

function oauth_common_user_consumers in OAuth 1.0 7.4

Same name and namespace in other branches
  1. 6.3 oauth_common.inc \oauth_common_user_consumers()
  2. 7.3 oauth_common.inc \oauth_common_user_consumers()

Return information about consumers related to a user.

Parameters

int $uid: User ID to retrieve consumer info for.

Return value

array An array of consumer info

1 call to oauth_common_user_consumers()
oauth_common_page_user_consumers in ./oauth_common.consumers.inc
Menu system callback for listing a users consumers.

File

./oauth_common.inc, line 11

Code

function oauth_common_user_consumers($uid) {
  $result = db_query('SELECT c.secret, c.configuration, pc.*
    FROM {oauth_common_consumer} c
    INNER JOIN {oauth_common_provider_consumer} pc ON pc.csid = c.csid
    WHERE pc.uid = :uid', array(
    ':uid' => $uid,
  ));
  $consumers = array();
  while ($consumer = DrupalOAuthConsumer::fromResult($result)) {
    $consumers[] = $consumer;
  }
  return $consumers;
}