You are here

public function OAuthStorePostgreSQL::authorizeConsumerRequestToken in Lingotek Translation 7.3

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

Upgrade a request token to be an authorized request token.

Parameters

string token:

int user_id user authorizing the token:

string referrer_host used to set the referrer host for this token, for user feedback:

Overrides OAuthStoreAbstract::authorizeConsumerRequestToken

File

lib/oauth-php/library/store/OAuthStorePostgreSQL.php, line 1298

Class

OAuthStorePostgreSQL

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;
}