You are here

public function OAuthStoreOracle::deleteConsumerAccessToken in Lingotek Translation 7.5

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

* Delete a consumer access token. * *

Parameters

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

Overrides OAuthStoreAbstract::deleteConsumerAccessToken

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

Class

OAuthStoreOracle

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);
  		}*/
  $sql = "BEGIN SP_DEL_CONSUMER_ACCESS_TOKEN(:P_USER_ID, :P_TOKEN, :P_USER_IS_ADMIN, :P_RESULT); END;";

  // parse sql
  $stmt = oci_parse($this->conn, $sql) or die('Can not parse query');

  // Bind In and Out Variables
  oci_bind_by_name($stmt, ':P_USER_ID', $user_id, 255);
  oci_bind_by_name($stmt, ':P_TOKEN', $token, 255);
  oci_bind_by_name($stmt, ':P_USER_IS_ADMIN', $user_is_admin, 20);
  oci_bind_by_name($stmt, ':P_RESULT', $result, 20);

  //Execute the statement
  oci_execute($stmt);
}