Skip to content

Commit 4efc44b

Browse files
committed
freekey workaround
1 parent 5ac32cf commit 4efc44b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

api/controller.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,19 @@ public function run(){
111111
$key = in_array($command, $this->apiCommands) ? $this->getRequest('apiKey', FALSE) : $this->getPostRequest('apiKey', FALSE);
112112
if(!$key || !$this->db->checkAPIkey($key)){
113113
$this->sendError(1, 'Invalid API key');
114-
}
114+
}
115115
$this->defaults = $this->db->getAPIKeyDefaults($key, $command);
116116

117117
if(in_array($command, $this->apiPostCommands)){
118+
// @todo: Temporary solution, special key property will be used later
119+
if($key == "freekey"){
120+
$this->sendError(1, 'Invalid API key');
121+
}
118122
$result = call_user_func(array($this, $command));
119123
return $result;
120124
}
121125

122126
$timestamp = $this->getRequest('timestamp', FALSE);
123-
124127
if(FALSE !== $timestamp){
125128
$cacheId = 'API-' . $command . '-' . md5($_SERVER["REQUEST_URI"]);
126129
$oCache = $this->db->getCache();

0 commit comments

Comments
 (0)