You are here

function DrupalOAuthDataStore::new_request_token in OAuth 1.0 6

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

File

./oauth.module, line 442

Class

DrupalOAuthDataStore
Database abstraction class

Code

function new_request_token($consumer) {
  $user_id = db_result(db_query("SELECT uid FROM {oauth_consumer} WHERE consumer_key='%s'", $consumer->key));
  $token = new OAuthToken(user_password(32), user_password(32));
  db_query("INSERT INTO {oauth_token} (consumer_key, type, token_key, token_secret, uid) VALUES ('%s', '%s', '%s', '%s', %d)", $consumer->key, 'request', $token->key, $token->secret, $user_id);
  return $token;
}