You are here

public function OAuthStorePostgreSQL::deleteServerToken in Lingotek Translation 7.7

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

Delete a token we obtained from a server.

Parameters

string consumer_key:

string token:

int user_id:

boolean user_is_admin:

Overrides OAuthStoreAbstract::deleteServerToken

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

Class

OAuthStorePostgreSQL

Code

public function deleteServerToken($consumer_key, $token, $user_id, $user_is_admin = false) {
  if ($user_is_admin) {
    $this
      ->query('
                DELETE FROM oauth_consumer_token
                    USING oauth_consumer_registry
                WHERE
                    oct_ocr_id_ref = ocr_id
                    AND ocr_consumer_key    = \'%s\'
                    AND oct_token            = \'%s\'
                ', $consumer_key, $token);
  }
  else {
    $this
      ->query('
                DELETE FROM oauth_consumer_token
                    USING oauth_consumer_registry
                WHERE
                    oct_ocr_id_ref = ocr_id
                    AND ocr_consumer_key    = \'%s\'
                    AND oct_token            = \'%s\'
                    AND oct_usa_id_ref    = \'%d\'
                ', $consumer_key, $token, $user_id);
  }
}