From efadd6eda15122944d95e1b3f01c3f4c35d1f40a Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 4 Dec 2021 15:42:09 +0100 Subject: Commit --- admin/callback/index.php | 8 +- admin/panes/home.php | 229 ++++++++++++++++++++++--------------------- admin/private/header.api.php | 9 +- admin/private/header.php | 9 +- admin/private/header.sso.php | 9 +- 5 files changed, 134 insertions(+), 130 deletions(-) (limited to 'admin') diff --git a/admin/callback/index.php b/admin/callback/index.php index 5052369..f938621 100644 --- a/admin/callback/index.php +++ b/admin/callback/index.php @@ -8,7 +8,7 @@ if (!isset($_GET['code'])) { $appdata = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/admin/private/app.json"), true); -$crl = curl_init('https://jetbrains.minteck.ro.lt:1024/hub/hub/api/rest/oauth2/token'); +$crl = curl_init('https://account.minteck.org/hub/hub/api/rest/oauth2/token'); curl_setopt($crl, CURLOPT_RETURNTRANSFER, true); curl_setopt($crl, CURLINFO_HEADER_OUT, true); curl_setopt($crl, CURLOPT_POST, true); @@ -17,7 +17,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://minteck.ro.lt/admin/callback") . "&code=" . $_GET['code']); +curl_setopt($crl, CURLOPT_POSTFIELDS, "grant_type=authorization_code&redirect_uri=" . urlencode("https://minteck.org/admin/callback") . "&code=" . $_GET['code']); $result = curl_exec($crl); $result = json_decode($result, true); @@ -25,7 +25,7 @@ $result = json_decode($result, true); curl_close($crl); if (isset($result["access_token"])) { - $crl = curl_init('https://jetbrains.minteck.ro.lt:1024/hub/hub/api/rest/users/me'); + $crl = curl_init('https://account.minteck.org/hub/hub/api/rest/users/me'); curl_setopt($crl, CURLOPT_RETURNTRANSFER, true); curl_setopt($crl, CURLINFO_HEADER_OUT, true); curl_setopt($crl, CURLOPT_HTTPHEADER, [ @@ -46,7 +46,7 @@ if (isset($result["access_token"])) { if ($login) { $token = bin2hex(random_bytes(32)); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/admin/private/tokens/" . $token, json_encode($result)); - setcookie("ADMIN_TOKEN", $token, 0, "/", ".minteck.ro.lt", true, true); + setcookie("ADMIN_TOKEN", $token, 0, "/", ".minteck.org", true, true); header("Location: /admin"); } else { diff --git a/admin/panes/home.php b/admin/panes/home.php index 3bc3429..f31dc72 100644 --- a/admin/panes/home.php +++ b/admin/panes/home.php @@ -1,115 +1,116 @@ - - - - -
-

!

- - - -
- + + + + +
+

!

+ + + +
+ + \ No newline at end of file diff --git a/admin/private/header.api.php b/admin/private/header.api.php index a8fdee8..c2d8f2f 100644 --- a/admin/private/header.api.php +++ b/admin/private/header.api.php @@ -1,23 +1,24 @@