public function OAuthStoreSQL::deleteServerToken in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::deleteServerToken()
- 7.2 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::deleteServerToken()
- 7.3 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::deleteServerToken()
- 7.4 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::deleteServerToken()
- 7.5 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::deleteServerToken()
* Delete a token we obtained from a server. * *
Parameters
string consumer_key: * @param string token * @param int user_id * @param boolean user_is_admin
Overrides OAuthStoreAbstract::deleteServerToken
1 call to OAuthStoreSQL::deleteServerToken()
- OAuthStoreSQL::setServerTokenTtl in lib/
oauth-php/ library/ store/ OAuthStoreSQL.php - * Set the ttl of a server access token. This is done when the * server receives a valid request with a xoauth_token_ttl parameter in it. * *
File
- lib/
oauth-php/ library/ store/ OAuthStoreSQL.php, line 628
Class
Code
public function deleteServerToken($consumer_key, $token, $user_id, $user_is_admin = false) {
if ($user_is_admin) {
$this
->query('
DELETE oauth_consumer_token
FROM oauth_consumer_token
JOIN oauth_consumer_registry
ON oct_ocr_id_ref = ocr_id
WHERE ocr_consumer_key = \'%s\'
AND oct_token = \'%s\'
', $consumer_key, $token);
}
else {
$this
->query('
DELETE oauth_consumer_token
FROM oauth_consumer_token
JOIN oauth_consumer_registry
ON oct_ocr_id_ref = ocr_id
WHERE ocr_consumer_key = \'%s\'
AND oct_token = \'%s\'
AND oct_usa_id_ref = %d
', $consumer_key, $token, $user_id);
}
}