public function OAuthStoreOracle::getServerToken in Lingotek Translation 7.3
Same name and namespace in other branches
- 7.7 lib/oauth-php/library/store/OAuthStoreOracle.php \OAuthStoreOracle::getServerToken()
- 7.2 lib/oauth-php/library/store/OAuthStoreOracle.php \OAuthStoreOracle::getServerToken()
- 7.4 lib/oauth-php/library/store/OAuthStoreOracle.php \OAuthStoreOracle::getServerToken()
- 7.5 lib/oauth-php/library/store/OAuthStoreOracle.php \OAuthStoreOracle::getServerToken()
- 7.6 lib/oauth-php/library/store/OAuthStoreOracle.php \OAuthStoreOracle::getServerToken()
* Get a specific server token for the given user * *
Parameters
string consumer_key: * @param string token * @param int user_id * @exception OAuthException2 when no such token found * @return array
Overrides OAuthStoreAbstract::getServerToken
File
- lib/
oauth-php/ library/ store/ OAuthStoreOracle.php, line 561
Class
Code
public function getServerToken($consumer_key, $token, $user_id) {
$sql = "BEGIN SP_GET_SERVER_TOKEN(:P_CONSUMER_KEY, :P_USER_ID,:P_TOKEN, :P_ROWS, :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_CONSUMER_KEY', $consumer_key, 255);
oci_bind_by_name($stmt, ':P_USER_ID', $user_id, 40);
oci_bind_by_name($stmt, ':P_TOKEN', $token, 255);
oci_bind_by_name($stmt, ':P_RESULT', $result, 20);
//Bind the ref cursor
$p_row = oci_new_cursor($this->conn);
oci_bind_by_name($stmt, ':P_ROWS', $p_row, -1, OCI_B_CURSOR);
//Execute the statement
oci_execute($stmt);
// treat the ref cursor as a statement resource
oci_execute($p_row, OCI_DEFAULT);
oci_fetch_all($p_row, $getServerTokenList, null, null, OCI_FETCHSTATEMENT_BY_ROW);
$ts = $getServerTokenList;
//
if (empty($ts)) {
throw new OAuthException2('No such consumer key (' . $consumer_key . ') and token (' . $token . ') combination for user "' . $user_id . '"');
}
return $ts;
}