diff --git a/public/index.php b/public/index.php index c43d927..e1d7d17 100644 --- a/public/index.php +++ b/public/index.php @@ -22,4 +22,25 @@ switch ($path) { break; } +function ReturnJsonResponse($data, $status = 200) { + http_response_code($status); + header('Content-Type: application/json'); + header('Cache-Control: no-cache, no-store, must-revalidate'); + echo json_encode($data); + exit; +} + +function request_access() { + $data = ['request access' => 'request not allowed']; + ReturnJsonResponse($data, 403); +} + +function deny_access() { + $data = ['deny access'=>'emergency user request revoked']; + ReturnJsonResponse($data); +} + +function user_interface() { + print('