diff options
-rw-r--r-- | apis/debugrequest.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apis/debugrequest.php b/apis/debugrequest.php index d9f1a169..5e51972b 100644 --- a/apis/debugrequest.php +++ b/apis/debugrequest.php @@ -1,18 +1,18 @@ <?php -$debug_settings = Property::getRemoteDebuggingConfig(); +/*$debug_settings = Property::getRemoteDebuggingConfig(); if ($debug_settings["status"] !== "enabled") { http_response_code(403); exit; -} +}*/ -$debug_request = json_decode(file_get_contents("php://input")); +$debug_request = file_get_contents("php://input"); -$validclient = Database::queryFirst("SELECT * FROM machine WHERE machineuuid = :uuid AND clientip = :ip", array(":uuid" => $debug_request["uuid"], ":ip" => $_SERVER["REMOTE_ADDR"])); +$validclient = Database::queryFirst("SELECT * FROM machine WHERE clientip = :ip", array(":ip" => $_SERVER["REMOTE_ADDR"])); if ($validclient == false) { http_response_code(400); } else { http_response_code(200); - $data = json_encode(array("uuid" => $debug_request["uuid"], "ip" => $_SERVER["REMOTE_ADDR"], "port" => $debug_request["port"])); + $data = json_encode(array("ip" => $_SERVER["REMOTE_ADDR"], "port" => 5900 + $debug_request)); Taskmanager::submit('relay', $data, true); } |