diff options
author | Minteck <contact@minteck.org> | 2023-02-22 10:29:48 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-22 10:29:48 +0100 |
commit | bf2558253637537c2d57765e557bdc0e164c58ee (patch) | |
tree | 9c50b253090001183ba574cc073d13f74e273758 /includes/session.inc | |
parent | 005bbb3c5b211dbb52cf8dcedac505f8a683cf42 (diff) | |
download | pluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.tar.gz pluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.tar.bz2 pluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.zip |
Updated 23 files, added assets/uploads/pt-princesscelestia.png and renamed assets/uploads/pt-luna.png (automated)
Diffstat (limited to 'includes/session.inc')
-rw-r--r-- | includes/session.inc | 46 |
1 files changed, 16 insertions, 30 deletions
diff --git a/includes/session.inc b/includes/session.inc index 4e2569c..5c94e92 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -1,41 +1,27 @@ <?php global $isLoggedIn; -global $isUserLoggedIn; +global $isLowerLoggedIn; global $_PROFILE; -if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) { - if (str_contains($_COOKIE['PEH2_SESSION_TOKEN'], ".") || str_contains($_COOKIE['PEH2_SESSION_TOKEN'], "/") || trim($_COOKIE["PEH2_SESSION_TOKEN"]) === "") { - $isLoggedIn = false; - } +$isLoggedIn = false; +$isLowerLoggedIn = false; - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) { - $_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN']))), true); - - if (isset($_GET['invert'])) { - $_PROFILE["login"] = $_PROFILE["login"] === "raindrops" ? "cloudburst" : "raindrops"; - $_PROFILE["name"] = $_PROFILE["name"] === "Raindrops System" ? "Cloudburst System" : "Raindrops System"; - } +if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) { + if (!(str_contains($_COOKIE['PEH2_SESSION_TOKEN'], ".") || str_contains($_COOKIE['PEH2_SESSION_TOKEN'], "/") || trim($_COOKIE["PEH2_SESSION_TOKEN"]) === "")) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) { + $_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN']))), true); - $isLoggedIn = true; - } else { - $isLoggedIn = false; - } -} else { - $isLoggedIn = false; -} + if (isset($_GET['invert'])) { + $_PROFILE["login"] = $_PROFILE["login"] === "raindrops" ? "cloudburst" : "raindrops"; + $_PROFILE["name"] = $_PROFILE["name"] === "Raindrops System" ? "Cloudburst System" : "Raindrops System"; + } -if (isset($_COOKIE['PEH2_USER_TOKEN'])) { - if (str_contains($_COOKIE['PEH2_USER_TOKEN'], ".") || str_contains($_COOKIE['PEH2_USER_TOKEN'], "/")) { - $isUserLoggedIn = false; - } + $isLoggedIn = true; + } elseif (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) { + $_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN']))), true); - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens-public/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_USER_TOKEN'])))) { - $_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens-public/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_USER_TOKEN']))), true); - $isUserLoggedIn = true; - } else { - $isUserLoggedIn = false; + $isLowerLoggedIn = true; + } } -} else { - $isUserLoggedIn = false; }
\ No newline at end of file |