diff options
author | RaindropsSys <raindrops@equestria.dev> | 2023-11-18 11:34:36 +0100 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2023-11-18 11:34:36 +0100 |
commit | 9337aae8b1c87fad34884dacd5cd79d9591c60db (patch) | |
tree | 5340f9fa67cd6236e4c879f0057d51d0b1e21361 /auth/callback/index.php | |
parent | 953ddd82e48dd206cef5ac94456549aed13b3ad5 (diff) | |
download | pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.gz pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.bz2 pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.zip |
Updated 39 files, added 86 files, deleted 40 files and renamed 2 files (automated)
Diffstat (limited to 'auth/callback/index.php')
-rw-r--r-- | auth/callback/index.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/auth/callback/index.php b/auth/callback/index.php index 1ff53f7..9697e63 100644 --- a/auth/callback/index.php +++ b/auth/callback/index.php @@ -21,7 +21,7 @@ curl_setopt($crl, CURLOPT_HTTPHEADER, [ "Content-Type: application/x-www-form-urlencoded", "Accept: application/json" ]); -curl_setopt($crl, CURLOPT_POSTFIELDS, "grant_type=authorization_code&redirect_uri=" . urlencode("https://ponies.equestria.horse/auth/callback") . "&code=" . $_GET['code']); +curl_setopt($crl, CURLOPT_POSTFIELDS, "grant_type=authorization_code&redirect_uri=" . urlencode("https://ponycule.equestria.horse/auth/callback") . "&code=" . $_GET['code']); $result = curl_exec($crl); $result = json_decode($result, true); @@ -42,7 +42,6 @@ if (isset($result["access_token"])) { 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(); } if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions"); @@ -57,17 +56,17 @@ if (isset($result["access_token"])) { "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"]))) . ")" + "name" => "Ponycule 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"]))) . ")" ])); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token, $result_orig); } else { - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/session/" . $token, json_encode([ + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/sessions/" . $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"] . ")" + "name" => "Ponycule Web (" . get_browser(null, true)["browser"] . " on " . get_browser(null, true)["platform"] . ")" ])); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/lowertokens/" . $token, $result_orig); |