diff options
Diffstat (limited to 'admin')
-rw-r--r-- | admin/callback/index.php | 8 | ||||
-rw-r--r-- | admin/panes/home.php | 229 | ||||
-rw-r--r-- | admin/private/header.api.php | 9 | ||||
-rw-r--r-- | admin/private/header.php | 9 | ||||
-rw-r--r-- | admin/private/header.sso.php | 9 |
5 files changed, 134 insertions, 130 deletions
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 @@ -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.php";/** @var array $_DATA */ ?>
-
-<style>
- ::-webkit-scrollbar {
- width: 5px;
- }
-
- ::-webkit-scrollbar-track {
- border-radius: 9999px;
- background: transparent;
- }
-
- ::-webkit-scrollbar-thumb {
- border-radius: 9999px;
- background-color: rgba(136, 136, 136, 0.5);
- transition: background 200ms;
- }
-
- ::-webkit-scrollbar-thumb:hover {
- background-color: rgba(85, 85, 85, 0.75);
- }
-
- ::-webkit-scrollbar-thumb:active {
- background-color: #222;
- }
-
- .list-group-item {
- background: #34373c;
- }
-</style>
-
-<div class="container" style="color:white;padding-top:15vh;padding-bottom:15vh;">
- <h2 style="text-align:center;"><?= l("Welcome back", "Vous revoilà") ?> <?= $_DATA["name"] ?><?= l("", " ") ?>!</h2>
- <ul class="list-group" style="margin-top:30px;">
- <li class="list-group-item">
- <span id="temperature"><?= l("Server running at", "Serveur fonctionnant à") ?> <b>--.-°C</b>, n/a</span> <a href="#" onclick="window.parent.activity('activity-version', '/admin/panes/version.php', window.parent.document.getElementById('activity-version'));" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li><li class="list-group-item"><b><?php
-
- $uca = scandir("/mnt/blogchain/_posts");
- $uct = [];
-
- foreach ($uca as $art) {
- if (is_file("/mnt/blogchain/_posts/" . $art) && substr($art, 0, 1) !== "." && substr($art, 0, 1) !== "_") {
- $uct[] = $art;
- }
- }
-
- echo(count($uct));
-
- ?></b> <?= l("UnchainedTech article·s", "article·s sur UnchainedTech") ?>, <?php
-
- $uca = scandir("/mnt/blogchain/_posts/_drafts");
- $uct2 = [];
-
- foreach ($uca as $art) {
- if (is_file("/mnt/blogchain/_posts/_drafts/" . $art) && substr($art, 0, 1) !== "." && substr($art, 0, 1) !== "_") {
- $uct2[] = $art;
- }
- }
-
- echo(count($uct2));
-
- ?> <?= l("draft·s", "brouillon·s") ?> <a onclick="window.parent.activity('activity-unchained', '/admin/panes/unchained.php', window.parent.document.getElementById('activity-unchained'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li>
- <li class="list-group-item"><b><?php
-
- $uca = scandir("/mnt/minteckrolt-cloud");
- $uct3 = [];
-
- foreach ($uca as $art) {
- if (is_dir("/mnt/minteckrolt-cloud/" . $art) && substr($art, 0, 1) === "~") {
- $uct3[] = $art;
- }
- }
-
- echo(count($uct3));
-
- ?></b> <?= l("Neutron Cloud website·s", "site·s Neutron Cloud") ?> <a onclick="window.parent.activity('activity-quotas', '/admin/panes/quotas.php', window.parent.document.getElementById('activity-quotas'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li>
- <li class="list-group-item"><b><?php
-
- $uca = scandir("/mnt/kartik/online/private/stats");
- $uct4 = [];
-
- foreach ($uca as $art) {
- if (is_file("/mnt/kartik/online/private/stats/" . $art)) {
- $uct4[] = $art;
- }
- }
-
- echo(count($uct4));
-
- ?></b> <?= l("Kartik Online player·s", "joueurs·s Kartik Online") ?> <a onclick="window.parent.activity('activity-kartik', '/admin/panes/kartik.php', window.parent.document.getElementById('activity-kartik'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li>
- <li class="list-group-item"><?= l("Using", "Utilisation de") ?> <b><?php
-
- exec("df -h -x tmpfs -x squashfs -x devtmpfs --total -P", $outdisk);
- $outn = explode(" ", preg_replace('/\s+/', ' ', $outdisk[count($outdisk) - 1]));
- echo($outn[2] . "/" . $outn[1]);
-
- ?></b> <?= l("on all disks", "sur tous les disques") ?>, <b><?php
-
- echo($outn[3]);
-
- ?></b> <?= l("free", "de libre") ?> <a onclick="window.parent.activity('activity-disk', '/admin/panes/disk.php', window.parent.document.getElementById('activity-disk'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li>
- </ul>
- <!--suppress JSUnresolvedVariable, JSUnresolvedFunction -->
- <script>
- setInterval(() => {
- $.ajax("/admin/api/serverTemp.php", {
- success: (data) => {
- document.getElementById("temperature").innerHTML = data;
- }
- });
- }, 500)
- </script>
-</div>
-
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.php";/** @var array $_DATA */ ?> + +<style> + ::-webkit-scrollbar { + width: 5px; + } + + ::-webkit-scrollbar-track { + border-radius: 9999px; + background: transparent; + } + + ::-webkit-scrollbar-thumb { + border-radius: 9999px; + background-color: rgba(136, 136, 136, 0.5); + transition: background 200ms; + } + + ::-webkit-scrollbar-thumb:hover { + background-color: rgba(85, 85, 85, 0.75); + } + + ::-webkit-scrollbar-thumb:active { + background-color: #222; + } + + .list-group-item { + background: #34373c; + } +</style> + +<div class="container" style="color:white;padding-top:15vh;padding-bottom:15vh;"> + <h2 style="text-align:center;"><?= l("Welcome back", "Vous revoilà") ?> <?= $_DATA["name"] ?><?= l("", " ") ?>!</h2> + <ul class="list-group" style="margin-top:30px;"> + <li class="list-group-item"> + <span id="temperature"><?= l("Server running at", "Serveur fonctionnant à") ?> <b>--.-°C</b>, n/a</span> <a href="#" onclick="window.parent.activity('activity-version', '/admin/panes/version.php', window.parent.document.getElementById('activity-version'));" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li><li class="list-group-item"><b><?php + + $uca = scandir("/mnt/blogchain/_posts"); + $uct = []; + + foreach ($uca as $art) { + if (is_file("/mnt/blogchain/_posts/" . $art) && substr($art, 0, 1) !== "." && substr($art, 0, 1) !== "_") { + $uct[] = $art; + } + } + + echo(count($uct)); + + ?></b> <?= l("UnchainedTech article·s", "article·s sur UnchainedTech") ?>, <?php + + $uca = scandir("/mnt/blogchain/_posts/_drafts"); + $uct2 = []; + + foreach ($uca as $art) { + if (is_file("/mnt/blogchain/_posts/_drafts/" . $art) && substr($art, 0, 1) !== "." && substr($art, 0, 1) !== "_") { + $uct2[] = $art; + } + } + + echo(count($uct2)); + + ?> <?= l("draft·s", "brouillon·s") ?> <a onclick="window.parent.activity('activity-unchained', '/admin/panes/unchained.php', window.parent.document.getElementById('activity-unchained'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li> + <li class="list-group-item"><b><?php + + $uca = scandir("/mnt/minteckrolt-cloud"); + $uct3 = []; + + foreach ($uca as $art) { + if (is_dir("/mnt/minteckrolt-cloud/" . $art) && substr($art, 0, 1) === "~") { + $uct3[] = $art; + } + } + + echo(count($uct3)); + + ?></b> <?= l("Neutron Cloud website·s", "site·s Neutron Cloud") ?> <a onclick="window.parent.activity('activity-quotas', '/admin/panes/quotas.php', window.parent.document.getElementById('activity-quotas'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li> + <li class="list-group-item"><b><?php + + $uca = scandir("/mnt/kartik/online/private/stats"); + $uct4 = []; + + foreach ($uca as $art) { + if (is_file("/mnt/kartik/online/private/stats/" . $art)) { + $uct4[] = $art; + } + } + + echo(count($uct4)); + + ?></b> <?= l("Kartik Online player·s", "joueurs·s Kartik Online") ?> <a onclick="window.parent.activity('activity-kartik', '/admin/panes/kartik.php', window.parent.document.getElementById('activity-kartik'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li> + <li class="list-group-item"><?= l("Using", "Utilisation de") ?> <b><?php + + exec("df -h -x tmpfs -x squashfs -x devtmpfs --total -P", $outdisk); + $outn = explode(" ", preg_replace('/\s+/', ' ', $outdisk[count($outdisk) - 1])); + echo($outn[2] . "/" . $outn[1]); + + ?></b> <?= l("on all disks", "sur tous les disques") ?>, <b><?php + + echo($outn[3]); + + ?></b> <?= l("free", "de libre") ?> <a onclick="window.parent.activity('activity-disk', '/admin/panes/disk.php', window.parent.document.getElementById('activity-disk'));" href="#" style="float:right;"><?= l("Manage", "Gérer") ?>...</a></li> + </ul> + <!--suppress JSUnresolvedVariable, JSUnresolvedFunction --> + <script> + setInterval(() => { + $.ajax("/admin/api/serverTemp.php", { + success: (data) => { + document.getElementById("temperature").innerHTML = data; + } + }); + }, 500) + </script> +</div> +<script src="https://bm.jae.su/web/libs/FtechWebring.client.js" async></script> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ 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 @@ <?php
if (!isset($_COOKIE["ADMIN_TOKEN"])) {
- header("Location: https://jetbrains.minteck.ro.lt:1024/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.ro.lt/admin/callback&scope=hub&request_credentials=default&access_type=offline");
+ header("Location: https://account.minteck.org/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.org/admin/callback&scope=hub&request_credentials=default&access_type=offline");
die();
} else if (ctype_xdigit($_COOKIE["ADMIN_TOKEN"]) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN'])) {
$_DATA = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN']), true);
} else {
- header("Location: https://jetbrains.minteck.ro.lt:1024/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.ro.lt/admin/callback&scope=hub&request_credentials=default&access_type=offline");
+ header("Location: https://account.minteck.org/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.org/admin/callback&scope=hub&request_credentials=default&access_type=offline");
die();
}
$_PERMSFORAPI = true;
require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/permissions.php";
-function l($en, $fr = null) {
+function l($en, $fr = null)
+{
global $lang;
if ((($lang === "fr" && isset($fr)) || (isset($_GET['fr']) && isset($fr) || isset($_COOKIE['fr']))) && !isset($_GET['en']) && !isset($_COOKIE['en']) && isset($fr)) {
- setlocale(LC_TIME, array('fr_FR.UTF-8','fr_FR@euro','fr_FR','french'));
+ setlocale(LC_TIME, array('fr_FR.UTF-8', 'fr_FR@euro', 'fr_FR', 'french'));
return $fr;
} else {
return $en;
diff --git a/admin/private/header.php b/admin/private/header.php index 454fa7d..d3d3ce8 100644 --- a/admin/private/header.php +++ b/admin/private/header.php @@ -1,12 +1,12 @@ <?php
if (!isset($_COOKIE["ADMIN_TOKEN"])) {
- header("Location: https://jetbrains.minteck.ro.lt:1024/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.ro.lt/admin/callback&scope=hub&request_credentials=default&access_type=offline");
+ header("Location: https://account.minteck.org/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.org/admin/callback&scope=hub&request_credentials=default&access_type=offline");
die();
} else if (ctype_xdigit($_COOKIE["ADMIN_TOKEN"]) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN'])) {
$_DATA = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN']), true);
} else {
- header("Location: https://jetbrains.minteck.ro.lt:1024/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.ro.lt/admin/callback&scope=hub&request_credentials=default&access_type=offline");
+ header("Location: https://account.minteck.org/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.org/admin/callback&scope=hub&request_credentials=default&access_type=offline");
die();
}
@@ -14,11 +14,12 @@ $_PERMSFORAPI = false; require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/permissions.php";
if (!function_exists("l")) {
- function l($en, $fr = null) {
+ function l($en, $fr = null)
+ {
global $lang;
if ((($lang === "fr" && isset($fr)) || (isset($_GET['fr']) && isset($fr) || isset($_COOKIE['fr']))) && !isset($_GET['en']) && !isset($_COOKIE['en']) && isset($fr)) {
- setlocale(LC_TIME, array('fr_FR.UTF-8','fr_FR@euro','fr_FR','french'));
+ setlocale(LC_TIME, array('fr_FR.UTF-8', 'fr_FR@euro', 'fr_FR', 'french'));
return $fr;
} else {
return $en;
diff --git a/admin/private/header.sso.php b/admin/private/header.sso.php index 5911f62..4dec3d9 100644 --- a/admin/private/header.sso.php +++ b/admin/private/header.sso.php @@ -1,23 +1,24 @@ <?php
if (!isset($_COOKIE["ADMIN_TOKEN"])) {
- header("Location: https://jetbrains.minteck.ro.lt:1024/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.ro.lt/admin/callback&scope=hub&request_credentials=default&access_type=offline");
+ header("Location: https://account.minteck.org/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.org/admin/callback&scope=hub&request_credentials=default&access_type=offline");
die();
} else if (ctype_xdigit($_COOKIE["ADMIN_TOKEN"]) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN'])) {
$_DATA = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN']), true);
} else {
- header("Location: https://jetbrains.minteck.ro.lt:1024/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.ro.lt/admin/callback&scope=hub&request_credentials=default&access_type=offline");
+ header("Location: https://account.minteck.org/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.org/admin/callback&scope=hub&request_credentials=default&access_type=offline");
die();
}
$_PERMSFORSSO = true;
require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/permissions.php";
-function l($en, $fr = null) {
+function l($en, $fr = null)
+{
global $lang;
if ((($lang === "fr" && isset($fr)) || (isset($_GET['fr']) && isset($fr) || isset($_COOKIE['fr']))) && !isset($_GET['en']) && !isset($_COOKIE['en']) && isset($fr)) {
- setlocale(LC_TIME, array('fr_FR.UTF-8','fr_FR@euro','fr_FR','french'));
+ setlocale(LC_TIME, array('fr_FR.UTF-8', 'fr_FR@euro', 'fr_FR', 'french'));
return $fr;
} else {
return $en;
|