summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-12 22:15:26 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-12 22:15:26 +0100
commit62a9199846b0c07c03218703b33e8385764f42d9 (patch)
tree912392b0adcae11d13fcd7f0e9436f76aeeae5f6
parentdb763c929a8bc77da74fbb80f156842dc313295e (diff)
downloadpluralconnect-62a9199846b0c07c03218703b33e8385764f42d9.tar.gz
pluralconnect-62a9199846b0c07c03218703b33e8385764f42d9.tar.bz2
pluralconnect-62a9199846b0c07c03218703b33e8385764f42d9.zip
Updated 2 files (automated)
-rw-r--r--auth/callback/index.php7
-rw-r--r--includes/components/header.inc2
2 files changed, 3 insertions, 6 deletions
diff --git a/auth/callback/index.php b/auth/callback/index.php
index 678dc34..1ff53f7 100644
--- a/auth/callback/index.php
+++ b/auth/callback/index.php
@@ -40,10 +40,7 @@ if (isset($result["access_token"])) {
$result = $result_orig = curl_exec($crl);
$result = json_decode($result, true);
- $isAllowed = in_array("78b519ca-759b-4caa-958d-fcdfd422b9a9", array_map(function ($i) { return $i["id"]; }, $result["transitiveGroups"]));
- $isAdmin = in_array("fe24dd97-9b9b-45b9-bb84-24e17a49f97b", array_map(function ($i) { return $i["id"]; }, $result["transitiveGroups"]));
-
- if (!$isAllowed) {
+ if (!in_array($result["id"], $appdata["oauth"]["allowed"]["admin"]) && !in_array($result["id"], $appdata["oauth"]["allowed"]["lower"])) {
peh_error("Access denied, you are not allowed to login to this website", 403);
die();
}
@@ -54,7 +51,7 @@ if (isset($result["access_token"])) {
$token = generateToken();
- if ($isAdmin) {
+ if (in_array($result["id"], $appdata["oauth"]["allowed"]["admin"])) {
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $token, json_encode([
"created" => time(),
"last" => time(),
diff --git a/includes/components/header.inc b/includes/components/header.inc
index 548716d..1f7d012 100644
--- a/includes/components/header.inc
+++ b/includes/components/header.inc
@@ -697,7 +697,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
if (
(($isLoggedIn || $isLowerLoggedIn) && !$use2023UI && isset($_COOKIE["enable2023UIcta"]) && $_COOKIE["enable2023UIcta"] === "yes") ||
(isset($_COOKIE["force2023UIcta"]) && $_COOKIE["force2023UIcta"] === "yes" && !$use2023UI) ||
- (($isLoggedIn || $isLowerLoggedIn) && isset($_PROFILE) && $_PROFILE["login"] === "raindrops" && !$use2023UI)
+ (($isLoggedIn || $isLowerLoggedIn) && isset($_PROFILE) && !$use2023UI)
) { ?>
<div class="modal fade" id="new-ui-cta">
<div class="modal-dialog">