You are here

public function OAuthStoreOracle::authorizeConsumerRequestToken in Lingotek Translation 7.3

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

* Upgrade a request token to be an authorized request token. * *

Parameters

string token: * @param int user_id user authorizing the token * @param string referrer_host used to set the referrer host for this token, for user feedback

Overrides OAuthStoreAbstract::authorizeConsumerRequestToken

File

lib/oauth-php/library/store/OAuthStoreOracle.php, line 1079

Class

OAuthStoreOracle

Code

public function authorizeConsumerRequestToken($token, $user_id, $referrer_host = '') {

  // 1.0a Compatibility : create a token verifier
  $verifier = substr(md5(rand()), 0, 10);
  $sql = "BEGIN SP_AUTH_CONSUMER_REQ_TOKEN(:P_USER_ID, :P_REFERRER_HOST, :P_VERIFIER, :P_TOKEN, :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_REFERRER_HOST', $referrer_host, 255);
  oci_bind_by_name($stmt, ':P_VERIFIER', $verifier, 255);
  oci_bind_by_name($stmt, ':P_TOKEN', $token, 255);
  oci_bind_by_name($stmt, ':P_RESULT', $result, 20);

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