You are here

public function OAuthStoreSQL::authorizeConsumerRequestToken in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.7 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::authorizeConsumerRequestToken()
  2. 7.2 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::authorizeConsumerRequestToken()
  3. 7.3 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::authorizeConsumerRequestToken()
  4. 7.5 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::authorizeConsumerRequestToken()
  5. 7.6 lib/oauth-php/library/store/OAuthStoreSQL.php \OAuthStoreSQL::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/OAuthStoreSQL.php, line 1298

Class

OAuthStoreSQL

Code

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

  // 1.0a Compatibility : create a token verifier
  $verifier = substr(md5(rand()), 0, 10);
  $this
    ->query('
					UPDATE oauth_server_token
					SET ost_authorized    = 1,
						ost_usa_id_ref    = %d,
						ost_timestamp     = NOW(),
						ost_referrer_host = \'%s\',
						ost_verifier      = \'%s\'
					WHERE ost_token      = \'%s\'
					  AND ost_token_type = \'request\'
					', $user_id, $referrer_host, $verifier, $token);
  return $verifier;
}