diff options
Diffstat (limited to 'pages/api/computer.php')
-rw-r--r-- | pages/api/computer.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pages/api/computer.php b/pages/api/computer.php index d3ec15a..8261fa8 100644 --- a/pages/api/computer.php +++ b/pages/api/computer.php @@ -1,12 +1,16 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $_PROFILE; +if (isset($_GET["chrome"])) { + header("Access-Control-Allow-Origin: chrome-extension://klenhenmabddpffgdaijdkjmfkkafbno"); +} + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE; if (!$isLoggedIn) header("Location: /-/login") and die(); $request_raw = file_get_contents('php://input'); $json_object = json_decode($request_raw, true); -$host = md5($json_object['host']); +$host = md5($json_object['host'] ?? $_GET["host"]); switch ($_GET['type']) { case "heartbeat": |