Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
improved revocation of consumer keys; updates #387
  • Loading branch information
following5 committed Mar 17, 2016
1 parent 1540b35 commit cf97cb2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions okapi/core.php
Expand Up @@ -2279,20 +2279,20 @@ public function __construct($options)
if (!$this->consumer) {
throw new InvalidParam('consumer_key', "Consumer does not exist.");
}
if ($this->consumer->hasFlag(OkapiConsumer::FLAG_KEY_REVOKED)) {
throw new BadRequest("Your application was denied access to the " .
Okapi::get_normalized_site_name() . " site " .
"(OKAPI consumer key was revoked).");
}
}
if (($this->opt_min_auth_level == 1) && (!$this->consumer))
throw new BadRequest("This method requires the 'consumer_key' argument (Level 1 ".
"Authentication). You didn't provide one.");
}
}

if (is_object($this->consumer) && $this->consumer->hasFlag(OkapiConsumer::FLAG_SKIP_LIMITS))
{
if (is_object($this->consumer) && $this->consumer->hasFlag(OkapiConsumer::FLAG_KEY_REVOKED)) {
throw new BadRequest("Your application was denied access to the " .
Okapi::get_normalized_site_name() . " site " .
"(OKAPI consumer key was revoked).");
}

if (is_object($this->consumer) && $this->consumer->hasFlag(OkapiConsumer::FLAG_SKIP_LIMITS)) {
$this->skip_limits = true;
}

Expand Down

0 comments on commit cf97cb2

Please sign in to comment.