public function consumerHandler()
	{
		$db = \App::get('db');

		if (!is_object($db))
		{
			return OAUTH_ERR_INTERNAL_ERROR;
		}

		$db->setQuery("SELECT * FROM `#__oauthp_consumers` WHERE token=" . $db->quote($this->_provider->consumer_key) . " LIMIT 1;");

		$result = $db->loadObject();

		if ($result === false)	// query failed
		{
			return OAUTH_ERR_INTERNAL_ERROR;
		}

		if (empty($result)) // key not found
		{
			return OAUTH_CONSUMER_KEY_UNKNOWN;
		}

		if ($result->state != 1) // key not in a valid state
		{
			return OAUTH_CONSUMER_KEY_REFUSED;
		}

		$this->_consumer_data = $result;
		$this->_provider->consumer_secret = $result->secret;

		return OAUTH_OK;
	}
public function consumerHandler()
	{
		$db = \App::get('db');

		if (!is_object($db))
		{
			return OAUTH_ERR_INTERNAL_ERROR;
		}

		$db->setQuery("SELECT * FROM `#__oauthp_consumers` WHERE token=" . $db->quote($this->_provider->consumer_key) . " LIMIT 1;");

		$result = $db->loadObject();

		if ($result === false)	// query failed
		{
			return OAUTH_ERR_INTERNAL_ERROR;
		}

		if (empty($result)) // key not found
		{
			return OAUTH_CONSUMER_KEY_UNKNOWN;
		}

		if ($result->state != 1) // key not in a valid state
		{
			return OAUTH_CONSUMER_KEY_REFUSED;
		}

		$this->_consumer_data = $result;
		$this->_provider->consumer_secret = $result->secret;

		return OAUTH_OK;
	}
public function consumerHandler ( ) { $ db = \ App :: get ( 'db' ) ; if ( ! is_object ( $ db ) ) { return OAUTH_ERR_INTERNAL_ERROR ; } $ db -> setQuery ( "SELECT * FROM `#__oauthp_consumers` WHERE token=" . $ db -> quote ( $ this -> _provider -> consumer_key ) . " LIMIT 1;" ) ; $ result = $ db -> loadObject ( ) ; if ( $ result === false ) // query failed { return OAUTH_ERR_INTERNAL_ERROR ; } if ( empty ( $ result ) ) // key not found { return OAUTH_CONSUMER_KEY_UNKNOWN ; } if ( $ result -> state != 1 ) // key not in a valid state { return OAUTH_CONSUMER_KEY_REFUSED ; } $ this -> _consumer_data = $ result ; $ this -> _provider -> consumer_secret = $ result -> secret ; return OAUTH_OK ; }
OAuthProvider consumerHandler Callback

Lookup requested consumer key secret

Result is stored in OAuthProvider instance's consumer_secret property
Consumer data record is stored in _consumer_data property

@return  OAUTH_OK on success
If consumer_key doesn't exist returns OAUTH_CONSUMER_KEY_UNKNOWN
If consumer_key is expired or otherwise invalid returns OAUTH_CONSUMER_KEY_REFUSED
If lookup process failed for some reason returns OAUTH_ERR_INTERNAL_ERROR
OAuthProvider consumerHandler Callback