You are here

function oauth_get_consumer in OAuth 1.0 6

Return consumer object for a user

If the consumer record does not exist, it will be created.

Parameters

uid: User ID to retrieve consumer object for.

Return value

Consumer object.

1 call to oauth_get_consumer()
oauth_user in ./oauth.module
Implementation of hook_user

File

./oauth.module, line 402

Code

function oauth_get_consumer($uid) {
  $result = db_query("SELECT * FROM {oauth_consumer} WHERE uid=%d", $uid);
  if ($object = db_fetch_object($result)) {
    return new OAuthConsumer($object->consumer_key, $object->consumer_secret);
  }
  else {
    return oauth_generate_consumer($uid);
  }
}