diff options
author | Christoph Schulthess | 2017-01-19 15:39:51 +0100 |
---|---|---|
committer | Christoph Schulthess | 2017-01-19 15:39:51 +0100 |
commit | 8daf28a8fe9c920d1dfb9cb8e465c0d2b3f63afc (patch) | |
tree | ba98d1ee20a798c60f15208619600f9dba83a27b /apis/debugrequest.php | |
parent | deactivated query (diff) | |
download | slx-admin-8daf28a8fe9c920d1dfb9cb8e465c0d2b3f63afc.tar.gz slx-admin-8daf28a8fe9c920d1dfb9cb8e465c0d2b3f63afc.tar.xz slx-admin-8daf28a8fe9c920d1dfb9cb8e465c0d2b3f63afc.zip |
preliminary debugrequest version
Diffstat (limited to 'apis/debugrequest.php')
-rw-r--r-- | apis/debugrequest.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apis/debugrequest.php b/apis/debugrequest.php index 8e0fd78b..4449e6eb 100644 --- a/apis/debugrequest.php +++ b/apis/debugrequest.php @@ -1,19 +1,19 @@ <?php - /*$debug_settings = Property::getRemoteDebuggingConfig(); if ($debug_settings["status"] !== "enabled") { http_response_code(403); exit; }*/ -$debug_request = json_decode(file_get_contents("php://input"), true); -//$validclient = Database::queryFirst("SELECT machineuuid, clientip FROM machine WHERE machineuuid = :uuid AND clientip = :ip", array(":uuid" => $debug_request["uuid"], ":ip" => \'$_SERVER["REMOTE_ADDR"]\')); -$validclient = true; +$debug_request = split(":", 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"])); +//$validclient = Database::simpleQuery("SELECT machineuuid, clientip FROM machine LIMIT 1;"); if ($validclient == false) { http_response_code(400); } else { http_response_code(200); - //$data = json_encode(array("ip" => $_SERVER["REMOTE_ADDR"], "port" => 5900 + $debug_request["display"])); - //Taskmanager::submit('relay', $data, true); + $data = json_encode(array("ip" => $_SERVER["REMOTE_ADDR"], "port" => 5900 + $debug_request["display"])); + Taskmanager::submit('relay', $data, true); } -//echo file_get_contents("php://input"); |