Fix error logic if no API key passed to provisioning/create API

This commit is contained in:
Albert Santoni 2015-07-31 11:43:58 -04:00
parent bda6a4585c
commit 84c21de578
1 changed files with 6 additions and 2 deletions

View File

@ -23,9 +23,13 @@ class ProvisioningHelper
* Zend app without the database unfortunately.)
*/
public function createAction()
{
$apikey = "";
if (isset($_SERVER['PHP_AUTH_USER']))
{
$apikey = $_SERVER['PHP_AUTH_USER'];
if (!isset($apikey) || $apikey != $this->apikey) {
}
if ($apikey != $this->apikey) {
Logging::info("Invalid API Key: $apikey");
http_response_code(403);
echo "ERROR: Incorrect API key";