check remote-ip when ip-restriction is set in api_keys table

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-23 11:08:24 +01:00
parent d9ec214e17
commit 8930d2a1bf
3 changed files with 34 additions and 7 deletions

View File

@@ -52,9 +52,13 @@ exit();
*
* @return void
*/
function json_response($status, $status_message, $data = null)
function json_response($status, $status_message = '', $data = null)
{
header("HTTP/1.1 " . $status);
$resheader = $_SERVER["SERVER_PROTOCOL"] . " " . $status;
if (! empty($status_message)) {
$resheader .= ' ' . $status_message;
}
header($resheader);
$response['status'] = $status;
$response['status_message'] = $status_message;