You are here

function DrupalOAuthDataStore::lookup_consumer in OAuth 1.0 6

Same name and namespace in other branches
  1. 6.3 includes/DrupalOAuthDataStore.inc \DrupalOAuthDataStore::lookup_consumer()
  2. 7.4 includes/DrupalOAuthDataStore.inc \DrupalOAuthDataStore::lookup_consumer()
  3. 7.3 includes/DrupalOAuthDataStore.inc \DrupalOAuthDataStore::lookup_consumer()

Overrides OAuthDataStore::lookup_consumer

File

./oauth.module, line 417

Class

DrupalOAuthDataStore
Database abstraction class

Code

function lookup_consumer($consumer_key) {
  $result = db_query("SELECT * FROM {oauth_consumer} WHERE consumer_key='%s'", $consumer_key);
  if ($object = db_fetch_object($result)) {
    return new OAuthConsumer($object->consumer_key, $object->consumer_secret);
  }
  return null;
}