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:
8
api.php
8
api.php
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user