From 718ee8df0e90c8665be707df88bb7acb1daff205 Mon Sep 17 00:00:00 2001 From: Christoph Schulthess Date: Thu, 18 May 2017 12:05:05 +0200 Subject: modified response for clientside parsing --- apis/debugrequest.inc.php | 45 ++++++++++++--------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/apis/debugrequest.inc.php b/apis/debugrequest.inc.php index 5c1323ba..35b16332 100644 --- a/apis/debugrequest.inc.php +++ b/apis/debugrequest.inc.php @@ -1,35 +1,37 @@ $DEBUG_SETTINGS["debugServer"], "port" => $DEBUG_SETTINGS["port"]); return Taskmanager::submit("RemoteDebug", $data); } @@ -38,33 +40,10 @@ function checkEnabled() { return $DEBUG_SETTINGS["enabled"]; } -function checkValid() { +function checkValid($DEBUG_REQUEST) { return Database::queryFirst("SELECT machineuuid, clientip FROM machine WHERE machineuuid = :uuid AND clientip = :ip", array(":uuid" => $DEBUG_REQUEST[0], ":ip" => $_SERVER["REMOTE_ADDR"])); } handleRequest(); -// $debug_settings = Property::getRemoteDebugConfig(); -// if ($debug_settings["enabled"] !== true) { -// http_response_code(403); -// exit; -// } - -// $debug_request = explode(":", file_get_contents("php://input"), 2); - -// $uuid = $debug_request[0]; -// $port = 5900 + $debug_request[1]; - -// $validclient = Database::queryFirst("SELECT machineuuid, clientip FROM machine WHERE machineuuid = :uuid AND clientip = :ip", array(":uuid" => "$debug_request[0]", ":ip" => $_SERVER["REMOTE_ADDR"])); - -// if ($validclient == false) { -// http_response_code(400); -// } else { -// http_response_code(200); -// $data = array("hosts" => array($_SERVER["REMOTE_ADDR"], $debug_settings["debugServer"]), -// "ports" => array($port, intval($debug_settings["port"])), "descs" => array("bwlpclient", "debugserver")); -// $taskstruct = Taskmanager::submit('DispatchRelay', $data); -// Property::addToList("DispatchedRelay", $taskstruct['id']); -// } - -- cgit v1.2.3-55-g7522