diff options
author | RaindropsSys <contact@minteck.org> | 2023-05-24 21:59:32 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-05-24 21:59:32 +0200 |
commit | 3e34d5ca6eb5566851f71fc79a8cbada599acd69 (patch) | |
tree | 0fb67a5f8e08a2d0f9773e430e42f56add41417c | |
parent | 2575c227f03fa73c57f84b478468acba665bbf2a (diff) | |
download | delta-3e34d5ca6eb5566851f71fc79a8cbada599acd69.tar.gz delta-3e34d5ca6eb5566851f71fc79a8cbada599acd69.tar.bz2 delta-3e34d5ca6eb5566851f71fc79a8cbada599acd69.zip |
Updated 7 files and added _icons/_mdi/dashboard.svg (automated)
-rw-r--r-- | _icons/_mdi/dashboard.svg | 1 | ||||
-rw-r--r-- | handoff/version/index.php | 2 | ||||
-rw-r--r-- | includes/header.php | 5 | ||||
-rw-r--r-- | includes/navigation.php | 2 | ||||
-rw-r--r-- | includes/oobe.php | 35 | ||||
-rw-r--r-- | login/index.php | 12 | ||||
-rw-r--r-- | login/oauth/index.php | 12 | ||||
-rw-r--r-- | version | 2 |
8 files changed, 49 insertions, 22 deletions
diff --git a/_icons/_mdi/dashboard.svg b/_icons/_mdi/dashboard.svg new file mode 100644 index 0000000..8584f7e --- /dev/null +++ b/_icons/_mdi/dashboard.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>
\ No newline at end of file diff --git a/handoff/version/index.php b/handoff/version/index.php index 2003491..859bb3e 100644 --- a/handoff/version/index.php +++ b/handoff/version/index.php @@ -28,7 +28,7 @@ if (isset($_PROFILE)) { $data["subscription"] = "plus"; } - $admin = $_PROFILE["admin"] ?? false; + $data["admin"] = $_PROFILE["admin"] ?? false; $data["name"] = $_PROFILE["nick_name"] ?? $_PROFILE["first_name"] . " " . $_PROFILE["last_name"]; } diff --git a/includes/header.php b/includes/header.php index 811b224..482eda3 100644 --- a/includes/header.php +++ b/includes/header.php @@ -867,4 +867,7 @@ if (isset($_GET["__"])) { </style> <?php endif; ?> -<div class="bg-white">
\ No newline at end of file +<div class="bg-white"> + <?php if (isset($_PROFILE)): ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/oobe.php"; ?> + <?php endif; ?> diff --git a/includes/navigation.php b/includes/navigation.php index 34fc557..186f779 100644 --- a/includes/navigation.php +++ b/includes/navigation.php @@ -346,6 +346,4 @@ } </script> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/oobe.php"; ?> - <div id="page">
\ No newline at end of file diff --git a/includes/oobe.php b/includes/oobe.php index 5971015..8abf079 100644 --- a/includes/oobe.php +++ b/includes/oobe.php @@ -21,7 +21,7 @@ <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div> - <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div> + <?php if (!isset($_COOKIE["DeltaHandoffPalette"])): ?><div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div><?php endif; ?> <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px;"></div> </div> <div style="display: flex; justify-content: end; width: 100%;"> @@ -52,7 +52,7 @@ <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div> - <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div> + <?php if (!isset($_COOKIE["DeltaHandoffPalette"])): ?><div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div><?php endif; ?> <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px;"></div> </div> <div style="display: flex; justify-content: end; width: 100%;"> @@ -85,7 +85,7 @@ <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div> - <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div> + <?php if (!isset($_COOKIE["DeltaHandoffPalette"])): ?><div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div><?php endif; ?> <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px;"></div> </div> <div style="display: flex; justify-content: end; width: 100%;"> @@ -118,11 +118,11 @@ <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> - <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div> + <?php if (!isset($_COOKIE["DeltaHandoffPalette"])): ?><div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px; margin-right: 5px;"></div><?php endif; ?> <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px;"></div> </div> <div style="display: flex; justify-content: end; width: 100%;"> - <a onclick="page(5);" class="btn btn-primary"><?= l("lang_oobe_next") ?></a> + <a onclick="if (document.cookie.includes('DeltaHandoffPalette=')) { page(6); } else { page(5); }" class="btn btn-primary"><?= l("lang_oobe_next") ?></a> </div> </div> </div> @@ -151,7 +151,7 @@ <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> - <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> + <?php if (!isset($_COOKIE["DeltaHandoffPalette"])): ?><div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div><?php endif; ?> <div style="width: 12px; height: 12px; background-color: var(--palette-3); border-radius: 999px;"></div> </div> <div style="display: flex; justify-content: end; width: 100%;"> @@ -191,14 +191,14 @@ <div style="display: grid; grid-template-columns: 1fr 1fr 1fr;"> <div style="display: flex; justify-content: start; width: 100%;"> - <a onclick="page(5, true);" class="btn btn-outline-primary"><?= l("lang_oobe_back") ?></a> + <a onclick="if (document.cookie.includes('DeltaHandoffPalette=')) { page(4, true); } else { page(5, true); }" class="btn btn-outline-primary"><?= l("lang_oobe_back") ?></a> </div> <div style="display: flex; justify-content: center; align-items: center; width: 100%;"> <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> - <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div> + <?php if (!isset($_COOKIE["DeltaHandoffPalette"])): ?><div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px; margin-right: 5px;"></div><?php endif; ?> <div style="width: 12px; height: 12px; background-color: var(--palette-9); border-radius: 999px;"></div> </div> <div style="display: flex; justify-content: end; width: 100%;"> @@ -222,7 +222,7 @@ <div style="display: flex; justify-content: start; width: 100%;"></div> <div style="display: flex; justify-content: center; align-items: center; width: 100%;"></div> <div style="display: flex; justify-content: end; width: 100%;"> - <a onclick="localStorage.setItem('oobe', '1');" data-bs-dismiss="modal" class="btn btn-primary"><?= l("lang_oobe_finish") ?></a> + <a onclick="document.cookie = 'DeltaOOBECompleted=1; Path=/';" data-bs-dismiss="modal" class="btn btn-primary"><?= l("lang_oobe_finish") ?></a> </div> </div> </div> @@ -324,11 +324,13 @@ <script> function page(n, back) { + let m = parseInt(Array.from(document.getElementsByClassName("oobe-page")).filter(i => i.style.display !== "none")[0].id.split("-")[2]); + if (back) { - document.getElementById("oobe-page-" + (n + 1)).classList.add("hiding-back"); + document.getElementById("oobe-page-" + m).classList.add("hiding-back"); setTimeout(() => { - document.getElementById("oobe-page-" + (n + 1)).classList.remove("hiding-back"); - document.getElementById("oobe-page-" + (n + 1)).style.display = "none"; + document.getElementById("oobe-page-" + m).classList.remove("hiding-back"); + document.getElementById("oobe-page-" + m).style.display = "none"; document.getElementById("oobe-page-" + n).classList.add("showing-back"); document.getElementById("oobe-page-" + n).style.display = ""; setTimeout(() => { @@ -336,10 +338,10 @@ }, 200); }, 200); } else { - document.getElementById("oobe-page-" + (n - 1)).classList.add("hiding"); + document.getElementById("oobe-page-" + m).classList.add("hiding"); setTimeout(() => { - document.getElementById("oobe-page-" + (n - 1)).classList.remove("hiding"); - document.getElementById("oobe-page-" + (n - 1)).style.display = "none"; + document.getElementById("oobe-page-" + m).classList.remove("hiding"); + document.getElementById("oobe-page-" + m).style.display = "none"; document.getElementById("oobe-page-" + n).classList.add("showing"); document.getElementById("oobe-page-" + n).style.display = ""; setTimeout(() => { @@ -351,8 +353,7 @@ const oobe = new bootstrap.Modal(document.getElementById("oobe")); - if (localStorage.getItem("oobe") !== "1") { - localStorage.removeItem("oobe"); + if (!document.cookie.includes("DeltaOOBECompleted=1")) { oobe.show(); document.getElementById("oobe").classList.add("fade"); } diff --git a/login/index.php b/login/index.php index ecba733..8bad962 100644 --- a/login/index.php +++ b/login/index.php @@ -49,6 +49,18 @@ if (isset($_POST["p"]) && $_POST["p"] === "1") { if (time() - strtotime($list[$_POST['code']]["date"]) > 900) { $error = "lang_login_invalid"; } else { + if ($_SERVER["HTTP_HOST"] === "192.168.1.121:81") { + $cont = false; + if (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $users[$_POST["email"]] . ".json"), true)["admin"]) { + $cont = true; + } + + if (!$cont) { + header("Location: https://delta.equestria.dev"); + die(); + } + } + sendLogin($_POST["email"]); $token = encode(openssl_random_pseudo_bytes(128)); diff --git a/login/oauth/index.php b/login/oauth/index.php index 8f52320..39e220d 100644 --- a/login/oauth/index.php +++ b/login/oauth/index.php @@ -51,6 +51,18 @@ if (isset($result["access_token"])) { if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens"); + if ($_SERVER["HTTP_HOST"] === "192.168.1.121:81") { + $cont = false; + if (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $users[$result["email"]] . ".json"), true)["admin"]) { + $cont = true; + } + + if (!$cont) { + header("Location: https://delta.equestria.dev"); + die(); + } + } + $token = encode(openssl_random_pseudo_bytes(128)); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, json_encode([ @@ -1 +1 @@ -5.1.13-rc1
\ No newline at end of file +5.1.14-rc2
\ No newline at end of file |