mirror of https://github.com/itflow-org/itflow
Deduplicate API GET check into single file
This commit is contained in:
parent
b4f2fdd03d
commit
17f97ff7bc
|
|
@ -1,13 +1,7 @@
|
|||
<?php
|
||||
require('../validate_api_key.php');
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] !== "GET"){
|
||||
header("HTTP/1.1 405 Method Not Allowed");
|
||||
$return_arr['success'] = "False";
|
||||
$return_arr['message'] = "Can only send GET requests to this endpoint.";
|
||||
echo json_encode($return_arr);
|
||||
exit();
|
||||
}
|
||||
require('../require_get_method.php');
|
||||
|
||||
// Asset via ID (single)
|
||||
if(isset($_GET['asset_id'])){
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
<?php
|
||||
require('../validate_api_key.php');
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] !== "GET"){
|
||||
header("HTTP/1.1 405 Method Not Allowed");
|
||||
$return_arr['success'] = "False";
|
||||
$return_arr['message'] = "Can only send GET requests to this endpoint.";
|
||||
echo json_encode($return_arr);
|
||||
exit();
|
||||
}
|
||||
require('../require_get_method.php');
|
||||
|
||||
// Specific certificate via ID (single)
|
||||
if(isset($_GET['certificate_id'])){
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
<?php
|
||||
require('../validate_api_key.php');
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] !== "GET"){
|
||||
header("HTTP/1.1 405 Method Not Allowed");
|
||||
$return_arr['success'] = "False";
|
||||
$return_arr['message'] = "Can only send GET requests to this endpoint.";
|
||||
echo json_encode($return_arr);
|
||||
exit();
|
||||
}
|
||||
require('../require_get_method.php');
|
||||
|
||||
// Specific contact via ID (single)
|
||||
if(isset($_GET['contact_id'])){
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
<?php
|
||||
require('../validate_api_key.php');
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] !== "GET"){
|
||||
header("HTTP/1.1 405 Method Not Allowed");
|
||||
$return_arr['success'] = "False";
|
||||
$return_arr['message'] = "Can only send GET requests to this endpoint.";
|
||||
echo json_encode($return_arr);
|
||||
exit();
|
||||
}
|
||||
require('../require_get_method.php');
|
||||
|
||||
// Specific domain via ID (single)
|
||||
if(isset($_GET['domain_id'])){
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
<?php
|
||||
require('../validate_api_key.php');
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] !== "GET"){
|
||||
header("HTTP/1.1 405 Method Not Allowed");
|
||||
$return_arr['success'] = "False";
|
||||
$return_arr['message'] = "Can only send GET requests to this endpoint.";
|
||||
echo json_encode($return_arr);
|
||||
exit();
|
||||
}
|
||||
require('../require_get_method.php');
|
||||
|
||||
// Specific network via ID (single)
|
||||
if(isset($_GET['network_id'])){
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
if($_SERVER['REQUEST_METHOD'] !== "GET"){
|
||||
header("HTTP/1.1 405 Method Not Allowed");
|
||||
$return_arr['success'] = "False";
|
||||
$return_arr['message'] = "Can only send GET requests to this endpoint.";
|
||||
echo json_encode($return_arr);
|
||||
exit();
|
||||
}
|
||||
|
|
@ -1,13 +1,7 @@
|
|||
<?php
|
||||
require('../validate_api_key.php');
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] !== "GET"){
|
||||
header("HTTP/1.1 405 Method Not Allowed");
|
||||
$return_arr['success'] = "False";
|
||||
$return_arr['message'] = "Can only send GET requests to this endpoint.";
|
||||
echo json_encode($return_arr);
|
||||
exit();
|
||||
}
|
||||
require('../require_get_method.php');
|
||||
|
||||
// Specific software via ID (single)
|
||||
if(isset($_GET['software_id'])){
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
<?php
|
||||
require('../validate_api_key.php');
|
||||
|
||||
if($_SERVER['REQUEST_METHOD'] !== "GET"){
|
||||
header("HTTP/1.1 405 Method Not Allowed");
|
||||
$return_arr['success'] = "False";
|
||||
$return_arr['message'] = "Can only send GET requests to this endpoint.";
|
||||
echo json_encode($return_arr);
|
||||
exit();
|
||||
}
|
||||
require('../require_get_method.php');
|
||||
|
||||
// Specific ticket via ID (single)
|
||||
if(isset($_GET['ticket_id'])){
|
||||
|
|
|
|||
Loading…
Reference in New Issue