private function validKeys() { $this->api_record = ApiKeys_ApiKeyDao::findByKey($this->api_key); return $this->api_record && $this->api_record->validSecret($this->api_secret); }
private function validateAuthHeader() { if ($_SERVER['HTTP_X_MATECAT_KEY'] == null) { return true; } $key = ApiKeys_ApiKeyDao::findByKey($_SERVER['HTTP_X_MATECAT_KEY']); if ($key && $key->validSecret($_SERVER['HTTP_X_MATECAT_SECRET'])) { Log::doLog($key); $this->current_user = $key->getUser(); return true; } else { return false; } }