API code style tidy

This commit is contained in:
Marcus Hill
2023-01-01 16:00:07 +00:00
parent 6746edda1a
commit ff741c223e
22 changed files with 461 additions and 461 deletions

View File

@@ -1,14 +1,14 @@
<?php
if($_SERVER['REQUEST_METHOD'] !== "POST"){
header("HTTP/1.1 405 Method Not Allowed");
$return_arr['success'] = "False";
$return_arr['message'] = "Can only send POST requests to this endpoint.";
echo json_encode($return_arr);
exit();
if ($_SERVER['REQUEST_METHOD'] !== "POST") {
header("HTTP/1.1 405 Method Not Allowed");
$return_arr['success'] = "False";
$return_arr['message'] = "Can only send POST requests to this endpoint.";
echo json_encode($return_arr);
exit();
}
// Client ID must be specific for INSERT/UPDATE/DELETE queries
// If this API key allows any client, set $client_id to the one specified, else leave it
if($client_id == 0){
$client_id = intval($_POST['client_id']);
if ($client_id == 0) {
$client_id = intval($_POST['client_id']);
}