You are here

public function OAuthStoreSQL::deleteConsumer in Lingotek Translation 7.4

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

* Delete a consumer key. This removes access to our site for all applications using this key. * *

Parameters

string consumer_key: * @param int user_id user registering this server * @param boolean user_is_admin

Overrides OAuthStoreAbstract::deleteConsumer

File

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

Class

OAuthStoreSQL

Code

public function deleteConsumer($consumer_key, $user_id, $user_is_admin = false) {
  if ($user_is_admin) {
    $this
      ->query('
					DELETE FROM oauth_server_registry
					WHERE osr_consumer_key = \'%s\'
					  AND (osr_usa_id_ref = %d OR osr_usa_id_ref IS NULL)
					', $consumer_key, $user_id);
  }
  else {
    $this
      ->query('
					DELETE FROM oauth_server_registry
					WHERE osr_consumer_key = \'%s\'
					  AND osr_usa_id_ref   = %d
					', $consumer_key, $user_id);
  }
}