summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Schulthess2017-01-18 14:35:10 +0100
committerChristoph Schulthess2017-01-18 14:35:10 +0100
commit55c78a769e66475c9f901828ce4ff4fb2f3057a9 (patch)
tree8b67b7d310d4ff1f0d9f1893358c122f80585ac4
parentadded debugrequest and functions in property (diff)
downloadslx-admin-55c78a769e66475c9f901828ce4ff4fb2f3057a9.tar.gz
slx-admin-55c78a769e66475c9f901828ce4ff4fb2f3057a9.tar.xz
slx-admin-55c78a769e66475c9f901828ce4ff4fb2f3057a9.zip
simplified debugrequest for testing purposes
-rw-r--r--apis/debugrequest.php10
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);
}