fixed security bug when ldap is enabled, the api was still accessible without auth

This commit is contained in:
Th3R3p0 2017-03-21 20:14:07 -04:00
parent 8db301b87d
commit e5afab8429

View File

@ -26,6 +26,13 @@ class Api extends Main
{ {
die("The API has been disabled\n"); die("The API has been disabled\n");
} }
// if ldap is configured and no api token is configured, fail the request
if ((config_item('require_auth') == true) && (config_item('apikey') == ''))
{
die("API key not configured");
}
} }
function index() function index()