You are here

public function OAuthStorePostgreSQL::deleteConsumerAccessToken in Lingotek Translation 7.7

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

Delete a consumer access token.

Parameters

string token:

int user_id:

boolean user_is_admin:

Overrides OAuthStoreAbstract::deleteConsumerAccessToken

1 call to OAuthStorePostgreSQL::deleteConsumerAccessToken()
OAuthStorePostgreSQL::setConsumerAccessTokenTtl in lib/oauth-php/library/store/OAuthStorePostgreSQL.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/OAuthStorePostgreSQL.php, line 1456

Class

OAuthStorePostgreSQL

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);
  }
}