/**
  * This function checks if the consumer exist in the DB and that it is active
  * You can modify it at your will but you __HAVE TO__ set $provider->consumer_secret to the right value or the signature will fail
  * It's called by OAuthCheckRequest()
  * @param $provider
  */
 public function checkConsumer($provider)
 {
     $return = OAUTH_CONSUMER_KEY_UNKNOWN;
     $aConsumer = Consumer::findByKey($provider->consumer_key);
     if (is_object($aConsumer)) {
         if (!$aConsumer->isActive()) {
             $return = OAUTH_CONSUMER_KEY_REFUSED;
         } else {
             $this->consumer = $aConsumer;
             $provider->consumer_secret = $this->consumer->getSecretKey();
             $return = OAUTH_OK;
         }
     }
     return $return;
 }