diff options
author | Christoph Schulthess | 2017-01-18 14:35:10 +0100 |
---|---|---|
committer | Christoph Schulthess | 2017-01-18 14:35:10 +0100 |
commit | 55c78a769e66475c9f901828ce4ff4fb2f3057a9 (patch) | |
tree | 8b67b7d310d4ff1f0d9f1893358c122f80585ac4 | |
parent | added debugrequest and functions in property (diff) | |
download | slx-admin-55c78a769e66475c9f901828ce4ff4fb2f3057a9.tar.gz slx-admin-55c78a769e66475c9f901828ce4ff4fb2f3057a9.tar.xz slx-admin-55c78a769e66475c9f901828ce4ff4fb2f3057a9.zip |
simplified debugrequest for testing purposes
-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); } |