You are here

public function OAuthStoreSQL::deleteConsumerAccessToken in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.2 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::deleteConsumerAccessToken()
  2. 7.3 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::deleteConsumerAccessToken()
  3. 7.4 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::deleteConsumerAccessToken()
  4. 7.5 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::deleteConsumerAccessToken()
  5. 7.6 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::deleteConsumerAccessToken()

* Delete a consumer access token. * *

Parameters

string token: * @param int user_id * @param boolean user_is_admin

Overrides OAuthStoreAbstract::deleteConsumerAccessToken

1 call to OAuthStoreSQL::deleteConsumerAccessToken()
OAuthStoreSQL::setConsumerAccessTokenTtl in lib/oauth-php/library/store/OAuthStoreSQL.php
* Set the ttl of a consumer 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 1452

Class

OAuthStoreSQL

Code

public function deleteConsumerAccessToken($token, $user_id, $user_is_admin = false) {
  if ($user_is_admin) {
    $this
      ->query('
						DELETE FROM oauth_server_token
						WHERE ost_token 	 = \'%s\'
						  AND ost_token_type = \'access\'
						', $token);
  }
  else {
    $this
      ->query('
						DELETE FROM oauth_server_token
						WHERE ost_token 	 = \'%s\'
						  AND ost_token_type = \'access\'
						  AND ost_usa_id_ref = %d
						', $token, $user_id);
  }
}