public static function DrupalOAuthToken::deleteToken in OAuth 1.0 7.3
Same name and namespace in other branches
- 6.3 includes/DrupalOAuthToken.inc \DrupalOAuthToken::deleteToken()
- 7.4 includes/DrupalOAuthToken.inc \DrupalOAuthToken::deleteToken()
Deletes the token with the key from the database
Parameters
string $key: The key of the token to delete.
object $consumer: The consumer for which to fetch a token
Return value
void
1 call to DrupalOAuthToken::deleteToken()
- DrupalOAuthToken::delete in includes/
DrupalOAuthToken.inc - Deletes the token from the database
File
- includes/
DrupalOAuthToken.inc, line 126
Class
Code
public static function deleteToken($key, $consumer) {
//TODO: Ensure backwards compatibility
$condition = db_and()
->condition('key_hash', sha1($key))
->condition('csid', $consumer->csid);
db_delete('oauth_common_provider_token')
->condition('tid', db_select('oauth_common_token', 't')
->condition($condition)
->fields('t', array(
'tid',
)), 'IN')
->execute();
db_delete('oauth_common_token')
->condition($condition)
->execute();
}