From 21ed7d0e837d74c1ebd8ada4396f96ce42c14fb1 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sat, 13 May 2023 19:25:44 +0200 Subject: Updated 14 files and added 6 files (automated) --- assets/icons/sessions.svg | 1 + auth/callback/index.php | 16 +++- includes/components/explicit.php | 2 +- includes/components/footer.inc | 5 +- includes/components/navigation.inc | 8 ++ includes/external/pair/reference.js | 13 ++- includes/pages.json | 7 ++ includes/util/functions.inc | 2 +- includes/util/session.inc | 42 ++++++++- pages/api.inc | 1 + pages/api/browser.php | 4 + pages/api/computer.php | 6 +- pages/api/disconnect.php | 26 ++++++ pages/api/reauthenticate.php | 8 +- pages/api/rename.php | 17 ++++ pages/api/session.php | 24 +++++ pages/home.inc | 7 ++ pages/logout.inc | 2 + pages/pair.inc | 32 ++++++- pages/sessions.inc | 182 ++++++++++++++++++++++++++++++++++++ 20 files changed, 389 insertions(+), 16 deletions(-) create mode 100644 assets/icons/sessions.svg create mode 100644 pages/api/browser.php create mode 100644 pages/api/disconnect.php create mode 100644 pages/api/rename.php create mode 100644 pages/api/session.php create mode 100644 pages/sessions.inc diff --git a/assets/icons/sessions.svg b/assets/icons/sessions.svg new file mode 100644 index 0000000..6cf4935 --- /dev/null +++ b/assets/icons/sessions.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/auth/callback/index.php b/auth/callback/index.php index 4fa1eba..75d73ea 100644 --- a/auth/callback/index.php +++ b/auth/callback/index.php @@ -51,9 +51,21 @@ if (isset($result["access_token"])) { $token = generateToken(); if (in_array($result["id"], $appdata["oauth"]["allowed"]["admin"])) { - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, json_encode($result)); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, json_encode([ + "created" => time(), + "last" => time(), + "profile" => $result, + "addresses" => [], + "name" => "Cold Haze Web (" . get_browser(null, true)["browser"] . " on " . str_replace("Windows dows", "Windows", str_replace("Win", "Windows ", str_replace("MacOSX", "macOS", get_browser(null, true)["platform"]))) . ")" + ])); } else { - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token, json_encode($result)); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token, json_encode([ + "created" => time(), + "last" => time(), + "profile" => $result, + "addresses" => [], + "name" => "Cold Haze Web (" . get_browser(null, true)["browser"] . " on " . get_browser(null, true)["platform"] . ")" + ])); } header("Set-Cookie: PEH2_SESSION_TOKEN=" . $token . "; SameSite=None; Path=/; Secure; HttpOnly; Expires=" . date("r", time() + (86400 * 730))); diff --git a/includes/components/explicit.php b/includes/components/explicit.php index 4c55896..f7b4533 100644 --- a/includes/components/explicit.php +++ b/includes/components/explicit.php @@ -1,4 +1,4 @@ - +