diff options
author | Minteck <contact@minteck.org> | 2022-01-01 10:37:28 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-01-01 10:37:28 +0100 |
commit | ef055e79855cf3be1ad5e1aa5f9ebad480062384 (patch) | |
tree | ff074b29a7a87c3ccfc3b10741bbe30cb28e103e /admin/panes | |
parent | e3a79df6428799024eac64e9cffbb062317aeb95 (diff) | |
download | main-trunk.tar.gz main-trunk.tar.bz2 main-trunk.zip |
Diffstat (limited to 'admin/panes')
-rw-r--r-- | admin/panes/audit.php | 252 | ||||
-rw-r--r-- | admin/panes/code.php | 43 | ||||
-rw-r--r-- | admin/panes/deneid.php | 81 | ||||
-rw-r--r-- | admin/panes/denied.php | 62 | ||||
-rw-r--r-- | admin/panes/disk.php | 81 | ||||
-rw-r--r-- | admin/panes/editor.php | 591 | ||||
-rw-r--r-- | admin/panes/files.php | 4 | ||||
-rw-r--r-- | admin/panes/hardware.lshw.php | 4 | ||||
-rw-r--r-- | admin/panes/hardware.php | 76 | ||||
-rw-r--r-- | admin/panes/home.php | 116 | ||||
-rw-r--r-- | admin/panes/kartik.php | 111 | ||||
-rw-r--r-- | admin/panes/neutroning.php | 65 | ||||
-rw-r--r-- | admin/panes/quotas.php | 56 | ||||
-rw-r--r-- | admin/panes/shortens.php | 93 | ||||
-rw-r--r-- | admin/panes/telemetry.php | 946 | ||||
-rw-r--r-- | admin/panes/unchained.php | 81 | ||||
-rw-r--r-- | admin/panes/uptime.php | 76 | ||||
-rw-r--r-- | admin/panes/version.php | 140 |
18 files changed, 0 insertions, 2878 deletions
diff --git a/admin/panes/audit.php b/admin/panes/audit.php deleted file mode 100644 index 3292ec8..0000000 --- a/admin/panes/audit.php +++ /dev/null @@ -1,252 +0,0 @@ -<?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;
- }
-
- table, table * {
- color: white !important;
- border-color: #292b2f !important;
- }
-
- th {
- border-top: 0 !important;
- }
-
- table a {
- color: #007bff !important;
- }
-
- td.users {
- width: 20vw;
- }
-
- .addr-location {
- width: 20vw;
- }
-</style>
-
-<div class="container" style="color:white;padding-top:15vh;padding-bottom:15vh;">
- <h2 style="text-align:center;"><?= l("Security Audit", "Audit de sécurité") ?></h2>
- <table class="table table-hover">
- <thead>
- <tr>
- <th><?= l("IP address", "Adresse IP") ?></th>
- <th><?= l("Connections", "Connexions") ?></th>
- <th><?= l("Username(s)", "Nom(s) d'utilisateur") ?></th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody><?php
-
- $ips = [];
- $data = "";
- $dir = scandir("/var/log");
-
- $dir = array_reverse($dir);
-
- /** @var array $perms */
- $viewFullIps = false;
- foreach ($perms as $user => $uperms) {
- if ($user === $_DATA['id']) {
- if (in_array("addresses", $uperms)) {
- $viewFullIps = true;
- }
- }
- }
-
- foreach ($dir as $file) {
- if ($file !== "." && $file !== "..") {
- if (substr($file, 0, 5) === "auth.") {
- if (substr($file, -3) === ".gz") {
- exec("gzip --decompress /var/log/" . $file);
- $raw = file_get_contents("/var/log/" . substr($file, 0, -3));
- } else {
- $raw = file_get_contents("/var/log/" . $file);
- }
-
- $data .= "\n" . $raw;
- }
- }
- }
-
- $lines = explode("\n", strip_tags($data));
- $lines = array_reverse($lines);
-
- foreach ($lines as $line) {
- if (trim($line) !== "" && strpos($line, "sshd") !== false && strpos($line, "error: kex_exchange_identification: Connection closed by remote host") === false && (strpos($line, "]: Connection closed by invalid user ") !== false || strpos($line, "]: Unable to negotiate with ") !== false || strpos($line, "]: Accepted publickey for ") !== false)) {
- $data = [];
-
- $parts = explode(": ", $line);
-
- $data["date"] = $parts[0];
- array_shift($parts);
- $data["message"] = implode(": ", $parts);
-
-
- if (substr($data["message"], 0, 23) === "Accepted publickey for ") { // Successful connection
- $data["status"] = "ok";
- $data["ip"] = explode(" ", $data["message"])[5];
- $data["user"] = explode(" ", $data["message"])[3];
- }
-
- if (substr($data["message"], 0, 25) === "Unable to negotiate with ") { // Errored connection
- $data["status"] = "error";
- $data["ip"] = explode(" ", $data["message"])[4];
- $data["user"] = null;
- }
-
- if (substr($data["message"], 0, 34) === "Connection closed by invalid user ") { // Invalid connection
- $data["status"] = "invalid";
- $data["ip"] = explode(" ", $data["message"])[count(explode(" ", $data["message"])) - 4];
- $data["user"] = explode(" ", $data["message"])[5];
- }
-
- if (!isset($ips[$data["ip"]])) {
- $ips[$data["ip"]] = [];
- }
- if (!isset($ips[$data["ip"]]["connections"])) {
- $ips[$data["ip"]]["connections"] = [];
- }
- $ips[$data["ip"]]["connections"][] = $data;
- }
- }
-
- $index = 1;
- foreach ($ips as $ip => $info) {
- if ($ip !== "port") {
- $pip = explode(".", $ip);
-
- if ($viewFullIps) {
- $rip = $ip;
- } else {
- if (strlen($pip[3]) === 3) $pip[3] = "xxx";
- if (strlen($pip[3]) === 2) $pip[3] = "xx";
- if (strlen($pip[3]) === 1) $pip[3] = "x";
-
- if (strlen($pip[2]) === 3) $pip[2] = "xxx";
- if (strlen($pip[2]) === 2) $pip[2] = "xx";
- if (strlen($pip[2]) === 1) $pip[2] = "x";
-
- $rip = implode(".", $pip);
- }
-
- echo("<tr>
- <td class='addr-location'><code>" . $rip . "</code><br><span id='iplocation-" . $ip . "'><span class='text-muted'>" . l("Please wait", "Patientez") . "...</span></span>");?>
- <!--suppress JSUnresolvedVariable -->
- <script>
-
- setTimeout(() => {
- document.getElementById("iplocation-<?= $ip ?>").innerHTML = $.ajax({
- type: "GET",
- url: "/admin/api/getIpLocation.php?_=<?= $ip ?>",
- async: false
- }).responseText;
- }, <?= $index ?> * 1000);
-
- </script>
- <?php
- if ($ip === $_SERVER['REMOTE_ADDR']) {
- echo(" <span class='badge text-primary border-primary' style='border:1px solid;vertical-align: middle;'>" . l("You", "Vous") . "</span>");
- }
- echo("</td>
- <td>");
-
- $success = 0;
- $invalid = 0;
- $failed = 0;
-
- foreach ($info["connections"] as $connection) {
- if ($connection["status"] === "invalid") {
- $invalid++;
- }
- if ($connection["status"] === "error") {
- $failed++;
- }
- if ($connection["status"] === "ok") {
- $success++;
- }
- }
- if (count($info["connections"]) === 0) {
- echo("<span class='text-muted'>" . l("Never connected", "Jamais connecté") . "</span>");
- } else {
- echo($success . " " . l("succeeded", "réussi") . ", " . $failed . " " . l("failed", "échoué") . ", " . $invalid . " " . l("invalid", "invalide"));
- }
-
- echo("<br>" . l("Last", "Dernier ") . ": ");
-
- if ($info["connections"][0]["status"] === "ok") {
- echo("<span class='badge text-success border-success' style='border:1px solid;vertical-align: middle;'>" . l("Succeeded", "Réussi") . "</span>");
- }
-
- if ($info["connections"][0]["status"] === "error") {
- echo("<span class='badge text-warning border-warning' style='border:1px solid;vertical-align: middle;'>" . l("Failed", "Échoué") . "</span>");
- }
-
- if ($info["connections"][0]["status"] === "invalid") {
- echo("<span class='badge text-danger border-danger' style='border:1px solid;vertical-align: middle;'>" . l("Invalid", "Invalide") . "</span>");
- }
-
- echo("</td>
- <td class='users'><details><summary>" . l("Show full list", "Afficher la liste") . "</summary><ul class='list-group'>");
-
- $uniqueUsers = [];
- $connectionsWithUsers = 0;
-
- foreach ($info["connections"] as $connection) {
- if (!in_array($connection["user"], $uniqueUsers) && $connection["user"] !== null) {
- if (isset($uniqueUsers[$connection["user"]])) {
- $uniqueUsers[$connection["user"]]++;
- $connectionsWithUsers++;
- } else {
- $uniqueUsers[$connection["user"]] = 1;
- $connectionsWithUsers++;
- }
- }
- }
-
- foreach ($uniqueUsers as $user => $occurrences) {
- echo("<li class='list-group-item'><code>" . $user . "</code> <span style='float:right;'>(" . $occurrences . "×, " . round(($occurrences/$connectionsWithUsers)*100, 2) . "%)</span></li>");
- }
-
- if (count($uniqueUsers) === 0) {
- echo("<li class='list-group-item text-muted'>" . l("Username was never sent to server", "Le nom d'utilisateur n'a jamais été transmis au service") . "</li>");
- }
-
- echo("</ul></details></td></td>
- <td><a href='https://cleantalk.org/blacklists/report-ip' target='_blank'>" . l("Report as fraudulent", "Signaler comme fraude") . "</a></td>
- </tr>");
-
- $index++;
- }
- }
-
- ?></tbody>
- </table>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/code.php b/admin/panes/code.php deleted file mode 100644 index 5c716e3..0000000 --- a/admin/panes/code.php +++ /dev/null @@ -1,43 +0,0 @@ -<?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;">Code of Conduct</h2>
-
- <h4 style="text-align:center;">editor powered by Neutron</h4>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item">English (primary) <span style="float:right;"><a href="/admin/panes/editor.php?file=conduct.en&name=Code%20of%20Conduct%20-%20English&context=code">Edit</a> · <a href="/code-of-conduct/?en" target="_blank">View</a></span></li>
- <li class="list-group-item">French <span style="float:right;"><a href="/admin/panes/editor.php?file=conduct.fr&name=Code%20of%20Conduct%20-%20French&context=code">Edit</a> · <a href="/code-of-conduct/?fr" target="_blank">View</a></span></li>
- </ul>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/deneid.php b/admin/panes/deneid.php deleted file mode 100644 index 8f3133f..0000000 --- a/admin/panes/deneid.php +++ /dev/null @@ -1,81 +0,0 @@ -<?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;display: flex;align-items:center;justify-content: center;height:100%;" id="main">
- <div>
- <p style="text-align: center;">
- <img src="/logo.svg" width="96px"><span class="text-muted"> ⏵⏵⏵ </span><!--suppress CheckImageSize -->
- <img src="/static/apps/unchainedtech.png" width="96px">
- </p>
- <br>
- <h2 style="text-align:center;">You already have access to UnchainedTech Admin</h2>
-
- <h4 style="text-align:center;">We automatically logged you into UnchainedTech Admin when you logged in to Minteck Admin</h4><br>
-
- <div style="text-align: center;width:max-content;margin-left:auto;margin-right:auto;">
- <p class="btn-group">
- <a href="https://unchainedtech.minteck.ro.lt/articles" target="_blank" class="btn btn-outline-light">All Articles</a>
- <a href="https://unchainedtech.minteck.ro.lt/admin" target="_blank" class="btn btn-outline-light">Admin Tasks</a>
- </p>
- </div>
-
- <small><p style="text-align: center;">
- v<?= trim(file_get_contents("/mnt/blogchain/version.txt")) ?> • <a href="#" onclick="document.getElementById('main').style.display='none';document.getElementById('secondary').style.display='';">Manage drafts</a>
- </p></small>
- </div>
-</div>
-
- <div class="container" style="color:white;padding-top:15vh;padding-bottom:15vh;display:none;" id="secondary">
- <div>
- <h2 style="text-align:center;">UnchainedTech</h2>
- <h4 style="text-align:center;">Drafts List</h4>
-
- <small><p style="text-align: center;">
- v<?= trim(file_get_contents("/mnt/blogchain/version.txt")) ?> • <a href="#" onclick="document.getElementById('main').style.display='flex';document.getElementById('secondary').style.display='none';">Hide drafts list</a>
- </p></small>
-
- <ul class="list-group">
- <?php
-
- $drafts = false;
- foreach (scandir("/mnt/blogchain/_posts/_drafts") as $draft) {
- if ($draft !== "." && $draft !== ".." && $draft !== ".gitkeep" && $draft !== "_template.md") {
- $drafts = true;
- echo('<li class="list-group-item">' . substr($draft, 0, -3) . '<span style="float:right;"><a href="https://unchainedtech.minteck.ro.lt/admin/article/' . substr($draft, 0, -3) . '" target="_blank">Preview</a> · <a href="https://github.com/Minteck/UnchainedTech-Content/edit/production/_drafts/' . $draft . '" target="_blank">Edit</a> · <a href="https://github.com/Minteck/UnchainedTech-Content/delete/production/_drafts/' . $draft . '" target="_blank">Delete</a></span></li>');
- }
- }
-
- ?>
- </ul>
- </div>
- </div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/denied.php b/admin/panes/denied.php deleted file mode 100644 index 9a29fcb..0000000 --- a/admin/panes/denied.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php require $_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;
- }
-
- body {
- background: #5f1b1b !important;
- }
-</style>
-
-<div class="container" style="color:white;padding-top:15vh;padding-bottom:15vh;display: flex;align-items:center;justify-content: center;height:100%;">
- <div>
- <p style="text-align: center;">
- <!--suppress CheckImageSize -->
- <img src="/static/admin/locked.svg" style="width:96px;filter:invert(1);">
- </p>
- <br>
- <h2 style="text-align:center;"><?= l("Access is denied", "Accès refusé") ?></h2>
-
- <h4 style="text-align:center;"><?= l("You don't have the", "Vous ne disposez pas de la permission") ?> <code>admin.<?= strip_tags($_GET['_'] ?? "*") ?></code><?= l(" permission, which is required to access this resource", ", qui est nécessaire pour accéder à ce contenu") ?>.</h4><br>
-
- <div id="homebtn" style="text-align: center;width:max-content;margin-left:auto;margin-right:auto;">
- <p class="btn-group">
- <a onclick="window.parent.activity('activity-home', '/admin/panes/home.php', window.parent.document.getElementById('activity-home'));" class="btn btn-outline-light"><?= l("Home", "Accueil") ?></a>
- </p>
- </div>
- <script>
- if (window.parent === window) document.getElementById("homebtn").style.display = "none";
- </script>
-
- <small><p style="text-align: center;">
- <?= l("If you believe this is an error", "Si vous pensez qu'il s'agit d'une erreur") ?>, <a href="/contact" target="_blank"><?= l("contact Minteck", "contactez Minteck") ?></a>
- </p></small>
- </div>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/disk.php b/admin/panes/disk.php deleted file mode 100644 index 72d772f..0000000 --- a/admin/panes/disk.php +++ /dev/null @@ -1,81 +0,0 @@ -<?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;">Disk Space Usage</h2>
- <pre style="background:#111;color:white;border-radius:5px;padding: 10px;"><?php
-
- exec("df -h -x tmpfs -x squashfs -x devtmpfs --total --output=source,fstype,size,used,avail,pcent,ipcent,iused,itotal,target", $disktotal);
- echo(implode("\n", $disktotal));
-
- ?>
- </pre>
- <ul class="list-group">
- <li class="list-group-item">
- <details>
- <summary>Show all filesystems (including RAM disks and pseudo-fs)</summary>
- <pre style="background:#111;color:white;border-radius:5px;padding: 10px;"><?php
-
- exec("df -ha --output=source,fstype,size,used,avail,pcent,ipcent,iused,itotal,target", $disktotal2);
- echo(implode("\n", $disktotal2));
-
- ?>
- </pre>
- </details>
- </li>
- <li class="list-group-item">
- <details>
- <summary>Show filesystems mount options</summary>
- <pre style="background:#111;color:white;border-radius:5px;padding: 10px;"><?php
-
- exec("mount", $disktotal3);
- echo(implode("\n", $disktotal3));
-
- ?>
- </pre>
- </details>
- </li>
- <li class="list-group-item">
- <details>
- <summary>Show block devices tree</summary>
- <pre style="background:#111;color:white;border-radius:5px;padding: 10px;"><?php
-
- exec("lsblk -mp", $disktotal4);
- echo(implode("\n", $disktotal4));
-
- ?>
- </pre>
- </details>
- </li>
- </ul>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/editor.php b/admin/panes/editor.php deleted file mode 100644 index b337060..0000000 --- a/admin/panes/editor.php +++ /dev/null @@ -1,591 +0,0 @@ -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.php";/** @var array $_DATA */
-
-if (isset($_GET['file']) && strpos($_GET['file'], "/") === false) {} else {
- die();
-}
-
-if (isset($_GET['name']) && strpos($_GET['name'], "/") === false) {} else {
- die();
-}
-
-if (isset($_GET['context']) && strpos($_GET['context'], "/") === false) {} else {
- die();
-}
-
-if (isset($_GET['article']) && strpos($_GET['article'], "/") === false) {} else {
- if (isset($_GET['article'])) {
- die();
- }
-}
-
-?>
-
-<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;">
- <p style="text-align: center;"><a href="/admin/panes/<?= $_GET['context'] ?>.php">← Go back</a></p>
- <h2 style="text-align:center;"><?= strip_tags($_GET['name']) ?></h2>
-
- <h4 id="autosave-status" style="text-align:center;transition:opacity 200ms;">Saved as draft</h4>
-
- <textarea name="content" id="editor"><?php
-
- if ($_GET['file'] === "conduct.fr") {
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/drafts/" . $_GET['file'] . ".html")) {
- echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/drafts/" . $_GET['file'] . ".html"));
- } else {
- echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/code/fr.html"));
- }
- }
-
- if ($_GET['file'] === "conduct.en") {
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/drafts/" . $_GET['file'] . ".html")) {
- echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/drafts/" . $_GET['file'] . ".html"));
- } else {
- echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/code/en.html"));
- }
- }
-
- if ($_GET['file'] === "blog.en") {
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/drafts/blog-{$_GET['article']}.json.html")) {
- echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/drafts/blog-{$_GET['article']}.json.html"));
- } else {
- echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/{$_GET['article']}.json.html"));
- }
- }
-
- if ($_GET['file'] === "blog.fr") {
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/drafts/blog-{$_GET['article']}.json.fr.html")) {
- echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/drafts/blog-{$_GET['article']}.json.fr.html"));
- } else {
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/{$_GET['article']}.json.fr.html")) {
- echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/{$_GET['article']}.json.fr.html"));
- } else {
- echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/{$_GET['article']}.json.html"));
- }
- }
- }
-
- ?></textarea>
-
- <br>
-
- <script src="/static/js/ckeditor.js"></script>
- <script>
- let colors = [{
- color: 'hsl(0, 0%, 0%)',
- },
- {
- color: 'hsl(0, 0%, 12.5%)',
- },
- {
- color: 'hsl(0, 0%, 25%)',
- },
- {
- color: 'hsl(0, 0%, 37.5%)',
- },
- {
- color: 'hsl(0, 0%, 50%)',
- },
- {
- color: 'hsl(0, 0%, 62.5%)',
- },
- {
- color: 'hsl(0, 0%, 75%)',
- },
- {
- color: 'hsl(0, 0%, 87.5%)',
- },
- {
- color: 'hsl(0, 0%, 100%)',
- hasBorder: true,
- },
- {
- color: 'hsl(0, 100%, 10%)',
- },
- {
- color: 'hsl(0, 100%, 12.5%)',
- },
- {
- color: 'hsl(0, 100%, 25%)',
- },
- {
- color: 'hsl(0, 100%, 37.5%)',
- },
- {
- color: 'hsl(0, 100%, 50%)',
- },
- {
- color: 'hsl(0, 100%, 62.5%)',
- },
- {
- color: 'hsl(0, 100%, 75%)',
- },
- {
- color: 'hsl(0, 100%, 87.5%)',
- },
- {
- color: 'hsl(0, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(30, 100%, 10%)',
- },
- {
- color: 'hsl(30, 100%, 12.5%)',
- },
- {
- color: 'hsl(30, 100%, 25%)',
- },
- {
- color: 'hsl(30, 100%, 37.5%)',
- },
- {
- color: 'hsl(30, 100%, 50%)',
- },
- {
- color: 'hsl(30, 100%, 62.5%)',
- },
- {
- color: 'hsl(30, 100%, 75%)',
- },
- {
- color: 'hsl(30, 100%, 87.5%)',
- },
- {
- color: 'hsl(30, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(60, 100%, 10%)',
- },
- {
- color: 'hsl(60, 100%, 12.5%)',
- },
- {
- color: 'hsl(60, 100%, 25%)',
- },
- {
- color: 'hsl(60, 100%, 37.5%)',
- },
- {
- color: 'hsl(60, 100%, 50%)',
- },
- {
- color: 'hsl(60, 100%, 62.5%)',
- },
- {
- color: 'hsl(60, 100%, 75%)',
- },
- {
- color: 'hsl(60, 100%, 87.5%)',
- },
- {
- color: 'hsl(60, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(90, 100%, 10%)',
- },
- {
- color: 'hsl(90, 100%, 12.5%)',
- },
- {
- color: 'hsl(90, 100%, 25%)',
- },
- {
- color: 'hsl(90, 100%, 37.5%)',
- },
- {
- color: 'hsl(90, 100%, 50%)',
- },
- {
- color: 'hsl(90, 100%, 62.5%)',
- },
- {
- color: 'hsl(90, 100%, 75%)',
- },
- {
- color: 'hsl(90, 100%, 87.5%)',
- },
- {
- color: 'hsl(90, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(120, 100%, 10%)',
- },
- {
- color: 'hsl(120, 100%, 12.5%)',
- },
- {
- color: 'hsl(120, 100%, 25%)',
- },
- {
- color: 'hsl(120, 100%, 37.5%)',
- },
- {
- color: 'hsl(120, 100%, 50%)',
- },
- {
- color: 'hsl(120, 100%, 62.5%)',
- },
- {
- color: 'hsl(120, 100%, 75%)',
- },
- {
- color: 'hsl(120, 100%, 87.5%)',
- },
- {
- color: 'hsl(120, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(150, 100%, 10%)',
- },
- {
- color: 'hsl(150, 100%, 12.5%)',
- },
- {
- color: 'hsl(150, 100%, 25%)',
- },
- {
- color: 'hsl(150, 100%, 37.5%)',
- },
- {
- color: 'hsl(150, 100%, 50%)',
- },
- {
- color: 'hsl(150, 100%, 62.5%)',
- },
- {
- color: 'hsl(150, 100%, 75%)',
- },
- {
- color: 'hsl(150, 100%, 87.5%)',
- },
- {
- color: 'hsl(150, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(180, 100%, 10%)',
- },
- {
- color: 'hsl(180, 100%, 12.5%)',
- },
- {
- color: 'hsl(180, 100%, 25%)',
- },
- {
- color: 'hsl(180, 100%, 37.5%)',
- },
- {
- color: 'hsl(180, 100%, 50%)',
- },
- {
- color: 'hsl(180, 100%, 62.5%)',
- },
- {
- color: 'hsl(180, 100%, 75%)',
- },
- {
- color: 'hsl(180, 100%, 87.5%)',
- },
- {
- color: 'hsl(180, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(210, 100%, 10%)',
- },
- {
- color: 'hsl(210, 100%, 12.5%)',
- },
- {
- color: 'hsl(210, 100%, 25%)',
- },
- {
- color: 'hsl(210, 100%, 37.5%)',
- },
- {
- color: 'hsl(210, 100%, 50%)',
- },
- {
- color: 'hsl(210, 100%, 62.5%)',
- },
- {
- color: 'hsl(210, 100%, 75%)',
- },
- {
- color: 'hsl(210, 100%, 87.5%)',
- },
- {
- color: 'hsl(210, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(240, 100%, 10%)',
- },
- {
- color: 'hsl(240, 100%, 12.5%)',
- },
- {
- color: 'hsl(240, 100%, 25%)',
- },
- {
- color: 'hsl(240, 100%, 37.5%)',
- },
- {
- color: 'hsl(240, 100%, 50%)',
- },
- {
- color: 'hsl(240, 100%, 62.5%)',
- },
- {
- color: 'hsl(240, 100%, 75%)',
- },
- {
- color: 'hsl(240, 100%, 87.5%)',
- },
- {
- color: 'hsl(240, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(270, 100%, 10%)',
- },
- {
- color: 'hsl(270, 100%, 12.5%)',
- },
- {
- color: 'hsl(270, 100%, 25%)',
- },
- {
- color: 'hsl(270, 100%, 37.5%)',
- },
- {
- color: 'hsl(270, 100%, 50%)',
- },
- {
- color: 'hsl(270, 100%, 62.5%)',
- },
- {
- color: 'hsl(270, 100%, 75%)',
- },
- {
- color: 'hsl(270, 100%, 87.5%)',
- },
- {
- color: 'hsl(270, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(300, 100%, 10%)',
- },
- {
- color: 'hsl(300, 100%, 12.5%)',
- },
- {
- color: 'hsl(300, 100%, 25%)',
- },
- {
- color: 'hsl(300, 100%, 37.5%)',
- },
- {
- color: 'hsl(300, 100%, 50%)',
- },
- {
- color: 'hsl(300, 100%, 62.5%)',
- },
- {
- color: 'hsl(300, 100%, 75%)',
- },
- {
- color: 'hsl(300, 100%, 87.5%)',
- },
- {
- color: 'hsl(300, 100%, 90%)',
- hasBorder: true,
- },
- {
- color: 'hsl(330, 100%, 10%)',
- },
- {
- color: 'hsl(330, 100%, 12.5%)',
- },
- {
- color: 'hsl(330, 100%, 25%)',
- },
- {
- color: 'hsl(330, 100%, 37.5%)',
- },
- {
- color: 'hsl(330, 100%, 50%)',
- },
- {
- color: 'hsl(330, 100%, 62.5%)',
- },
- {
- color: 'hsl(330, 100%, 75%)',
- },
- {
- color: 'hsl(330, 100%, 87.5%)',
- },
- {
- color: 'hsl(330, 100%, 90%)',
- hasBorder: true,
- }];
- let editor;
- ClassicEditor
- .create( document.querySelector( '#editor' ), {
- toolbar: [
- 'undo', 'redo', '|', 'removeFormat', '|', 'heading', '|', 'fontSize', 'fontColor', 'fontBackgroundColor', 'alignment', '|', 'bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|', 'code', '|', 'outdent', 'indent', '|', 'bulletedList', 'numberedList', '|', 'link', 'imageUpload', 'mediaEmbed', 'blockQuote', 'insertTable', 'codeBlock', '|', 'horizontalLine'
- ],
- fontColor: {
- colors: colors,
- columns: 9
- },
- autosave: {
- save( editor ) {
- return saveData( editor.getData() );
- }
- },
- } )
-
- .then( newEditor => {
- editor = newEditor;
- } )
- .catch( error => {
- console.error( error );
- } );
- </script>
- <!--suppress JSUnresolvedVariable, JSUnresolvedFunction, JSUnfilteredForInLoop -->
- <script>
- function publish() {
- $("html, body").animate({scrollTop: 0}, 100);
- document.getElementById("autosave-status").style.opacity = "0";
- setTimeout(() => {
- document.getElementById("autosave-status").innerText = "Publishing...";
- document.getElementById("autosave-status").style.opacity = "1";
- setTimeout(() => {
- $.ajax("/admin/api/setlive.php", {
- dataType: 'text',
- type: 'post',
- contentType: 'application/x-www-form-urlencoded',
- data: {
- document: "<?= $_GET['file'] ?>",
- <?= isset($_GET['article']) ? "article: \"{$_GET['article']}\"" : "" ?>
- },
- success: (data) => {
- document.getElementById("autosave-status").style.opacity = "0";
- setTimeout(() => {
- document.getElementById("autosave-status").innerText = "Published";
- document.getElementById("autosave-status").style.opacity = "1";
- }, 200)
- document.getElementById("publish-btn").disabled = data.trim() === "false";
- },
- error: (e) => {
- console.error(e);
- document.getElementById("autosave-status").style.opacity = "0";
- setTimeout(() => {
- document.getElementById("autosave-status").innerText = "Unable to publish";
- document.getElementById("autosave-status").style.opacity = "1";
- }, 200)
- alert("An error prevents publishing the document. You may continue editing it but your changes may not be automatically saved on the server");
- }
- });
- }, 200)
- }, 200)
- }
-
- function saveData(data) {
- document.getElementById("autosave-status").style.opacity = "0";
- setTimeout(() => {
- document.getElementById("autosave-status").innerText = "Saving...";
- document.getElementById("autosave-status").style.opacity = "1";
- setTimeout(() => {
- $.ajax("/admin/api/autosave.php", {
- dataType: 'text',
- type: 'post',
- contentType: 'application/x-www-form-urlencoded',
- data: {
- document: "<?= $_GET['file'] ?>",
- <?= isset($_GET['article']) ? "article: \"{$_GET['article']}\"," : "" ?>
- content: data
- },
- success: (data) => {
- $.ajax("/admin/api/draftvslive.php", {
- dataType: 'text',
- type: 'post',
- contentType: 'application/x-www-form-urlencoded',
- data: {
- document: "<?= $_GET['file'] ?>",
- <?= isset($_GET['article']) ? "article: \"{$_GET['article']}\"" : "" ?>
- },
- success: (data) => {
- document.getElementById("autosave-status").style.opacity = "0";
- setTimeout(() => {
- document.getElementById("autosave-status").innerText = "Saved as draft";
- document.getElementById("autosave-status").style.opacity = "1";
- }, 200)
- document.getElementById("publish-btn").disabled = data.trim() === "true";
- },
- error: (e) => {
- console.error(e);
- document.getElementById("autosave-status").style.opacity = "0";
- setTimeout(() => {
- document.getElementById("autosave-status").innerText = "Unable to save";
- document.getElementById("autosave-status").style.opacity = "1";
- }, 200)
- alert("An error prevents saving the document. You may continue editing it but your changes won't be automatically saved on the server");
- }
- });
- },
- error: (e) => {
- console.error(e);
- document.getElementById("autosave-status").style.opacity = "0";
- setTimeout(() => {
- document.getElementById("autosave-status").innerText = "Unable to save";
- document.getElementById("autosave-status").style.opacity = "1";
- }, 200)
- alert("An error prevents saving the document. You may continue editing it but your changes won't be automatically saved on the server");
- }
- });
- }, 200)
- }, 200)
- }
- </script>
-
- <link rel="stylesheet" href="/static/css/editor.css">
- <p style="text-align: center;"><button id="publish-btn" onclick="publish();" class="btn btn-primary">Publish changes</button></p>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/files.php b/admin/panes/files.php deleted file mode 100644 index 5f836de..0000000 --- a/admin/panes/files.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/tinyfilemanager.php";
\ No newline at end of file diff --git a/admin/panes/hardware.lshw.php b/admin/panes/hardware.lshw.php deleted file mode 100644 index f50c1ce..0000000 --- a/admin/panes/hardware.lshw.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php - -exec("sudo lshw -html -quiet", $ret); -echo(implode("\n", $ret));
\ No newline at end of file diff --git a/admin/panes/hardware.php b/admin/panes/hardware.php deleted file mode 100644 index 05c839f..0000000 --- a/admin/panes/hardware.php +++ /dev/null @@ -1,76 +0,0 @@ -<?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><?php
-
-function command($command) {
- $data = [];
- exec($command, $data);
- return implode("\n", $data);
-}
-
-?>
-
-<div class="container" style="color:white;padding-top:15vh;padding-bottom:15vh;">
- <h2 style="text-align:center;">Hardware Information</h2>
- <ul class="list-group">
- <li class="list-group-item">
- <details>
- <summary>General system information</summary>
- <iframe src="/admin/panes/hardware.lshw.php" style="border:none;width:100%;height:100vh;"></iframe>
- </details>
- </li>
- <li class="list-group-item">
- <details>
- <summary>Attached PCI devices</summary>
- <pre style="background:#111;color:white;border-radius:5px;padding: 10px;"><?= command("lspci") ?></pre>
- </details>
- </li>
- <li class="list-group-item">
- <details>
- <summary>Attached USB devices</summary>
- <pre style="background:#111;color:white;border-radius:5px;padding: 10px;"><?= command("lsusb -t") ?></pre>
- </details>
- </li>
- <li class="list-group-item">
- <details>
- <summary>Attached processors</summary>
- <pre style="background:#111;color:white;border-radius:5px;padding: 10px;"><?= command("lscpu") ?></pre>
- </details>
- </li>
- <li class="list-group-item">
- <details>
- <summary>Loaded kernel modules</summary>
- <pre style="background:#111;color:white;border-radius:5px;padding: 10px;"><?= command("lsmod") ?></pre>
- </details>
- </li>
- </ul>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/home.php b/admin/panes/home.php deleted file mode 100644 index f31dc72..0000000 --- a/admin/panes/home.php +++ /dev/null @@ -1,116 +0,0 @@ -<?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/panes/kartik.php b/admin/panes/kartik.php deleted file mode 100644 index 10b47f5..0000000 --- a/admin/panes/kartik.php +++ /dev/null @@ -1,111 +0,0 @@ -<?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;">
- <div>
- <h2 style="text-align:center;">Kartik Online</h2>
- <h4 style="text-align:center;"><?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));
-
- ?> player·s</h4>
-
- <ul class="list-group">
- <?php
-
- $uca = scandir("/mnt/kartik/online/private/stats");
- $uct4 = [];
-
- foreach ($uca as $art) {
- if (is_file("/mnt/kartik/online/private/stats/" . $art)): ?>
-
- <li class="list-group-item"><?= $art ?> <?php
-
- $osession = 0;
- $gsession = 0;
- $tsession = 0;
-
- $webs = scandir("/mnt/kartik/online/private/tokens");
- $ings = scandir("/mnt/kartik/online/private/gametokens");
-
- foreach ($webs as $webt) {
- if (!is_dir("/mnt/kartik/online/private/tokens/" . $webt)) {
- $d = json_decode(file_get_contents("/mnt/kartik/online/private/tokens/" . $webt), true);
- if ($d["id"] === $art) {
- $osession++;
- }
- }
- }
-
- foreach ($ings as $webt) {
- if (!is_dir("/mnt/kartik/online/private/gametokens/" . $webt)) {
- $d = json_decode(file_get_contents("/mnt/kartik/online/private/gametokens/" . $webt), true);
- if ($d["id"] === $art) {
- $gsession++;
- }
- }
- }
-
- $tsession = $osession + $gsession;
- if ($tsession > 1) {
- $tsessions = "s";
- } else {
- $tsessions = "";
- }
-
- if ($osession > 0) {
- echo("<span class='badge text-warning border-warning' style='border:1px solid;vertical-align: middle;'>{$tsession} session{$tsessions} ({$gsession}:{$osession})</span>");
- } else if ($gsession > 0) {
- echo("<span class='badge text-success border-success' style='border:1px solid;vertical-align: middle;'>{$tsession} session{$tsessions} ({$gsession}:0)</span>");
- } else {
- echo("<span class='badge text-light border-light' style='border:1px solid;vertical-align: middle;'>Offline (0:0)</span>");
- }
-
- ?> <span style="float:right;"><a href="/admin/api/terminateWebSessions.php?_=<?= $art ?>">Terminate Web</a> · <a href="/admin/api/terminateGameSessions.php?_=<?= $art ?>">Terminate Game</a> · <a href="/admin/api/terminateAllSessions.php?_=<?= $art ?>">Terminate All</a></span></li>
-
- <?php endif;
- }
-
- ?>
- </ul>
- </div>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/neutroning.php b/admin/panes/neutroning.php deleted file mode 100644 index 07a64a6..0000000 --- a/admin/panes/neutroning.php +++ /dev/null @@ -1,65 +0,0 @@ -<?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("Neutron Cloud Map", "Plan de Neutron Cloud") ?></h2>
-
- <h4 style="text-align:center;"><?= l("Full map of all the websites that exists in Neutron Cloud", "Plan complet de tous les sites Web qui existent dans Neutron Cloud") ?></h4>
-
- <details open>
- <summary>cloud.minteck.ro.lt</summary>
- <?php $index=1;foreach (scandir("/mnt/minteckrolt-cloud") as $site): if (substr($site, 0, 1) === "~"): ?>
- <details open style="margin-left:23px;">
- <summary><a target="_blank" href="https://cloud.minteck.ro.lt/<?= $site ?>/?source=minteck-admin"><?= $site ?></a></summary>
- <details open style="margin-left:23px;">
- <summary>cms-special</summary>
- <ul style="margin:0;">
- <li><a target="_blank" href="https://cloud.minteck.ro.lt/<?= $site ?>/cms-special/admin">admin</a></li>
- <li><a target="_blank" href="https://cloud.minteck.ro.lt/<?= $site ?>/cms-special/calendar">calendar</a></li>
- <li><a target="_blank" href="https://cloud.minteck.ro.lt/<?= $site ?>/cms-special/gallery">gallery</a></li>
- <li><a target="_blank" href="https://cloud.minteck.ro.lt/<?= $site ?>/cms-special/version">version</a></li>
- </ul>
- </details>
- <ul style="margin:0;">
- <?php foreach (scandir("/mnt/minteckrolt-cloud/" . $site . "/data/webcontent/pages") as $page): if (trim($page) !== "." && trim($page) !== ".."): ?>
- <?php if ($page === "index"): ?>
- <li><a target="_blank" href="https://cloud.minteck.ro.lt/<?= $site ?>"><?= $page ?>.php</a></li>
- <?php else: ?>
- <li><a target="_blank" href="https://cloud.minteck.ro.lt/<?= $site ?>/<?= $page ?>"><?= $page ?></a></li>
- <?php endif; ?>
- <?php endif;endforeach; ?>
- </ul>
- </details>
- <?php $index++;endif;endforeach; ?>
- </details>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/quotas.php b/admin/panes/quotas.php deleted file mode 100644 index 8102a0d..0000000 --- a/admin/panes/quotas.php +++ /dev/null @@ -1,56 +0,0 @@ -<?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("Neutron Cloud Quotas", "Quotas de Neutron Cloud") ?></h2>
-
- <h4 style="text-align:center;"><?= l("Websites that reached their limit can be locked down", "Les sites Web qui ont atteint leur limite peuvent être bloqués") ?></h4>
-
- <ul class="list-group" style="margin-top:20px;">
- <?php $index=1;foreach (scandir("/mnt/minteckrolt-cloud") as $site): if (substr($site, 0, 1) === "~"): ?>
- <li class="list-group-item"><i><?= strip_tags(file_get_contents("/mnt/minteckrolt-cloud/" . $site . "/data/webcontent/sitename")) ?></i> (<a href="https://cloud.minteck.ro.lt/<?= $site ?>" target="_blank"><code><?= $site ?></code></a>, <?= l("X", "Tier X") ?><?= trim(file_get_contents("/mnt/minteckrolt-cloud/" . $site . "/Tier")) ?><?= l(" Tier", "") ?>)<br><span class="text-muted" id="quota-<?= $index ?>"><?= l("Calculating", "Calcul") ?>...</span><span style="float:right;"><a href="/admin/NeutronManage/?_=<?= $site ?>" target="_blank"><?= l("Admin Panel", "Espace d'administration") ?></a></span><!--suppress JSUnresolvedVariable, JSUnresolvedFunction, JSUnfilteredForInLoop -->
- <script>
- setTimeout(() => {
- $.ajax("/admin/api/getQuota.php?_=<?= $site ?>", {
- async: false,
- success: (data) => {
- document.getElementById("quota-<?= $index ?>").innerHTML = data;
- },
- error: () => {
- document.getElementById("quota-<?= $index ?>").innerText = "<?= l("An error occurred while loading this content, perhaps you don't have permission to access it", "Une erreur s'est produite lors du chargement de ce contenu, peut-être que vous n'avez pas la permission d'y accéder") ?>";
- }
- });
- }, 1000 * <?= $index ?>)
- </script></li>
- <?php $index++;endif;endforeach; ?>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/shortens.php b/admin/panes/shortens.php deleted file mode 100644 index 165c198..0000000 --- a/admin/panes/shortens.php +++ /dev/null @@ -1,93 +0,0 @@ -<?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;">Shortened URLs</h2>
-
- <ul class="list-group" style="margin-top:20px;">
- <?php
-
- $links = explode("\n", file_get_contents("/mnt/minteckrolt-urls/links.txt"));
-
- foreach ($links as $link) {
- if (trim($link) !== "") {
- $url = explode(" ", $link)[0];
- $redirect = explode(" ", $link)[1];
-
- echo('<li class="list-group-item"><code>https://mt.ro.lt/<a href="https://mt.ro.lt/' . $url . '" target="_blank">' . $url . '</a></code> <span style="float:right;"><a href="#" onclick="deleteURL(\'' . $url . '\')">Delete</a></span></li>');
- }
- }
-
- ?><li class="list-group-item">
- <form id="creator" action="/admin/api/createURL.php">
- <code>https://mt.ro.lt/<input type="text" name="shortenedName" placeholder="superurl"></code> → <input type="text" name="redirectsTo" placeholder="https://kde.org"> <span style="float:right;"><a href="#" onclick="document.getElementById('creator').submit();">Create</a></span>
- </form>
- </li>
- </ul>
-</div>
-
-<script>
- let currurl;
-
- function deleteURL(url) {
- currurl = url;
-
- $("#myModal").modal()
- }
-
- function confirmDelete(url) {
- location.href = "/admin/api/deleteURL.php?_=" + url;
- }
-</script>
-
- <div class="modal" id="myModal">
- <div class="modal-dialog">
- <div class="modal-content">
-
- <div class="modal-header">
- <h4 class="modal-title">Delete this shortened URL?</h4>
- <button type="button" class="close" data-dismiss="modal">×</button>
- </div>
-
- <div class="modal-body">
- This cannot be undone and may have unwanted side effects. After this URL is deleted, it will redirect to Minteck's Space's homepage.
- </div>
-
- <div class="modal-footer">
- <button type="button" class="btn btn-success" onclick="confirmDelete(currurl);">Confirm</button>
- <button type="button" class="btn btn-danger" data-dismiss="modal">Cancel</button>
- </div>
-
- </div>
- </div>
- </div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/telemetry.php b/admin/panes/telemetry.php deleted file mode 100644 index 74064c9..0000000 --- a/admin/panes/telemetry.php +++ /dev/null @@ -1,946 +0,0 @@ -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.php";/** @var array $_DATA */
-
-function urlize($scheme) {
- $p = explode(":", $scheme);
-
- if ($p[0] === "space") {
- return "https://minteck.ro.lt" . $p[1];
- }
-
- if ($p[0] === "unchained") {
- return "https://unchainedtech.minteck.ro.lt" . $p[1];
- }
-
- if ($p[0] === "kartik") {
- return "https://kartik.hopto.org" . $p[1];
- }
-
- return "about:blank";
-}
-
-?>
-
-<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("Telemetry Information", "Informations de télémétrie") ?></h2>
-
- <?php $db = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/telemetry.json")); ?>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item"><?= l("Lifetime Visitors", "Visiteurs depuis toujours") ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $months) {
- foreach ($months as $days) {
- foreach ($days as $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
-
- echo (count($uniques));
-
- ?></span></li>
- <li class="list-group-item"><?= l("Most Viewed Page", "Page la plus vue") ?> <span style="float:right;"><?php
-
- $record = 0;
- $recname = "-";
-
- foreach ($db as $months) {
- foreach ($months as $days) {
- foreach ($days as $pages) {
- foreach ($pages as $page => $visitors) {
- $thispage = 0;
-
- foreach ($visitors as $visitor) {
- $thispage++;
- }
-
- if ($thispage > $record) {
- $recname = "<a href='" . urlize($page) . "' target='_blank'><code>" . $page . "</code></a>";
- $record = $thispage;
- }
- }
- }
- }
- }
-
- echo ($recname);
-
- ?></span></li>
- <li class="list-group-item"><?= l("Least Viewed Page", "Page la moins vue") ?> <span style="float:right;"><?php
-
- $record = 2;
- $recname = "-";
-
- foreach ($db as $months) {
- foreach ($months as $days) {
- foreach ($days as $pages) {
- foreach ($pages as $page => $visitors) {
- $thispage = 0;
-
- foreach ($visitors as $visitor) {
- $thispage++;
- }
-
- if ($thispage < $record) {
- $recname = "<a href='" . urlize($page) . "' target='_blank'><code>" . $page . "</code></a>";
- $record = $thispage;
- }
- }
- }
- }
- }
-
- echo ($recname);
-
- ?></span></li>
- </ul>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item text-muted"><?= l("Tomorrow", "Demain") ?> <span style="float:right;"><?php
-
- $uniques = [];
- $totalDays = 0;
-
- foreach ($db as $months) {
- foreach ($months as $days) {
- foreach ($days as $pages) {
- $totalDays++;
- $dayUniques = [];
-
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $dayUniques)) {
- array_push($dayUniques, $visitor);
- }
- }
- }
-
- $uniques = array_merge($uniques, $dayUniques);
- }
- }
- }
-
- $expect = round(count($uniques) / $totalDays);
- echo ($expect);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- if ($day === date('d')) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($expect - count($uniques)), 0, 1) !== "-") {
- if ((int)($expect - count($uniques)) === 0) {
- echo("<span style='color:orange;opacity:.5;'> (±" . ($expect - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;opacity:.5;'> (+" . ($expect - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;opacity:.5;'> (" . ($expect - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= l("Today", "Aujourd'hui") ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- if ($day === date('d')) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- if ($day === date('d', strtotime("-1 day"))) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= l("Yesterday", "Hier") ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- if ($day === date('d', strtotime("-1 day"))) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- $yesterday = count($uniques);
- echo ($yesterday);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- if ($day === date('d', strtotime("-2 day"))) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($yesterday - count($uniques)), 0, 1) !== "-") {
- if ((int)($yesterday - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($yesterday - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($yesterday - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($yesterday - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- </ul>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item text-muted"><?= date("F Y", strtotime("+1 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
- $totalDays = 0;
-
- foreach ($db as $months) {
- foreach ($months as $days) {
- $totalDays++;
- $dayUniques = [];
-
- foreach ($days as $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $dayUniques)) {
- array_push($dayUniques, $visitor);
- }
- }
- }
- }
-
- $uniques = array_merge($uniques, $dayUniques);
- }
- }
-
- $expect = round(count($uniques) / $totalDays);
- echo ($expect);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($expect - count($uniques)), 0, 1) !== "-") {
- if ((int)($expect - count($uniques)) === 0) {
- echo("<span style='color:orange;opacity:.5;'> (±" . ($expect - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;opacity:.5;'> (+" . ($expect - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;opacity:.5;'> (" . ($expect - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= date("F Y") ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m')) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-1 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= date("F Y", strtotime("-1 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-1 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-2 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= date("F Y", strtotime("-2 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-2 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-3 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li><li class="list-group-item"><?= date("F Y", strtotime("-3 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-3 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-4 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li><li class="list-group-item"><?= date("F Y", strtotime("-4 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-4 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-5 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li><li class="list-group-item"><?= date("F Y", strtotime("-5 month")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-5 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- if ($month === date('m', strtotime("-6 month"))) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- </ul>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item"><?= date("Y") ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y')) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y', strtotime("-1 year"))) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= date("Y", strtotime("-1 year")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y', strtotime("-1 year"))) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y', strtotime("-2 year"))) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- <li class="list-group-item"><?= date("Y", strtotime("-2 year")) ?> <span style="float:right;"><?php
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y', strtotime("-2 year"))) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- $today = count($uniques);
- echo ($today);
-
- $uniques = [];
-
- foreach ($db as $year => $months) {
- if ($year === date('y', strtotime("-3 year"))) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- foreach ($visitors as $visitor) {
- if (!in_array($visitor, $uniques)) {
- array_push($uniques, $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- if (substr((string)($today - count($uniques)), 0, 1) !== "-") {
- if ((int)($today - count($uniques)) === 0) {
- echo("<span style='color:orange;'> (±" . ($today - count($uniques)) . ")</span>");
- } else {
- echo("<span style='color:limegreen;'> (+" . ($today - count($uniques)) . ")</span>");
- }
- } else {
- echo("<span style='color:red;'> (" . ($today - count($uniques)) . ")</span>");
- }
-
- ?></span></li>
- </ul>
-
- <br>
-
- <ul class="list-group">
- <li class="list-group-item">
- <details>
- <summary><?= l("Kartik downloads", "Téléchargements de Kartik") ?></summary>
- <ul class="list-group">
- <li class="list-group-item"><b><?= l("All update channels", "Tous les canaux de mise à jour") ?> <span style="float:right;"><?= (int)trim(file_get_contents("/mnt/kartik-cdn/stats/stable")) + (int)trim(file_get_contents("/mnt/kartik-cdn/stats/eap")) + (int)trim(file_get_contents("/mnt/kartik-cdn/stats/beta")) + (int)trim(file_get_contents("/mnt/kartik-cdn/stats/nightly")) ?> downloads</span></b></li>
- <li class="list-group-item"><img alt="" src="https://github.com/Minteck-Projects/Kartik-Core/raw/testing/logo/logo.png" width="24px"> Kartik Stable <span style="float:right;"><?= trim(file_get_contents("/mnt/kartik-cdn/stats/stable")) ?> downloads</span></li>
- <li class="list-group-item"><img alt="" src="https://github.com/Minteck-Projects/Kartik-Core/raw/testing/logo/logo-eap.png" width="24px"> Kartik EAP <span style="float:right;"><?= trim(file_get_contents("/mnt/kartik-cdn/stats/eap")) ?> <?= l("downloads", "téléchargements") ?></span></li>
- <li class="list-group-item"><img alt="" src="https://github.com/Minteck-Projects/Kartik-Core/raw/testing/logo/logo-beta.png" width="24px"> Kartik Beta <span style="float:right;"><?= trim(file_get_contents("/mnt/kartik-cdn/stats/beta")) ?> <?= l("downloads", "téléchargements") ?></span></li>
- <li class="list-group-item"><img alt="" src="https://github.com/Minteck-Projects/Kartik-Core/raw/testing/logo/logo-nightly.png" width="24px"> Kartik Nightly <span style="float:right;"><?= trim(file_get_contents("/mnt/kartik-cdn/stats/nightly")) ?> <?= l("downloads", "téléchargements") ?></span></li>
- </ul>
- </details>
- </li>
- <li class="list-group-item">
- <details>
- <summary><?= l("Page-specific statistics", "Statistiques par page") ?></summary>
- <p>
- <?php
-
- $assocs = [];
- $spages = [];
-
- foreach ($db as $year => $months) {
- foreach ($months as $month => $days) {
- foreach ($days as $day => $pages) {
- foreach ($pages as $page => $visitors) {
- if (substr($page, 0, 7) !== "/admin/") {
- if (!isset($spages[$page])) {
- $spages[$page] = 0;
- }
- foreach ($visitors as $visitor) {
- if (!in_array($page . "|" . $visitor, $assocs)) {
- $spages[$page]++;
- array_push($assocs, $page . "|" . $visitor);
- }
- }
- }
- }
- }
- }
- }
-
- $max = 0;
- foreach ($spages as $visitors) {
- if ($visitors > $max) {
- $max = $visitors;
- }
- }
-
- arsort($spages);
-
- foreach ($spages as $page => $visitors): ?>
- <div class="progress" style="height:25px;background:#222;margin-bottom:2px;">
- <div class="progress-bar" style="background:#444;width:<?= ($visitors/$max)*100 ?>%;"></div>
- <span class="progress-bar-text"><a class="text-white" href="<?= urlize($page) ?>" target="_blank"><?= $page ?></a> <span class="text-muted">(<?= $visitors ?>)</span></span>
- </div>
- <?php endforeach; ?>
- </p>
-
- <style>
- .progress-bar-text {
- position: absolute;
- padding-top: 14px;
- font-size: 14px;
- text-align:left;
- padding-left:10px;
- }
- </style>
- </details>
- </li>
- </ul>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/unchained.php b/admin/panes/unchained.php deleted file mode 100644 index 5f29406..0000000 --- a/admin/panes/unchained.php +++ /dev/null @@ -1,81 +0,0 @@ -<?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;display: flex;align-items:center;justify-content: center;height:100%;" id="main">
- <div>
- <p style="text-align: center;">
- <img src="/logo.svg" width="96px"><span class="text-muted"> ⏵⏵⏵ </span><!--suppress CheckImageSize -->
- <img src="/static/apps/unchainedtech.png" width="96px">
- </p>
- <br>
- <h2 style="text-align:center;"><?= l("You already have access to UnchainedTech Admin", "Vous avez déjà accès à l'administration de UnchainedTech") ?></h2>
-
- <h4 style="text-align:center;"><?= l("We automatically logged you into UnchainedTech Admin when you logged in to Minteck Cloud Admin Console", "Nous vous avons automatiquement connecté à l'administration d'UnchainedTech lorsque vous vous êtes connecté à Minteck Cloud Admin Console") ?></h4><br>
-
- <div style="text-align: center;width:max-content;margin-left:auto;margin-right:auto;">
- <p class="btn-group">
- <a href="https://unchainedtech.minteck.ro.lt/articles" target="_blank" class="btn btn-outline-light"><?= l("All Articles", "Tous les articles") ?></a>
- <a href="https://unchainedtech.minteck.ro.lt/admin" target="_blank" class="btn btn-outline-light"><?= l("Admin Tasks", "Tâches d'administration") ?></a>
- </p>
- </div>
-
- <small><p style="text-align: center;">
- v<?= trim(file_get_contents("/mnt/blogchain/version.txt")) ?> • <a href="#" onclick="document.getElementById('main').style.display='none';document.getElementById('secondary').style.display='';"><?= l("Manage drafts", "Gérer les brouillons") ?></a>
- </p></small>
- </div>
-</div>
-
- <div class="container" style="color:white;padding-top:15vh;padding-bottom:15vh;display:none;" id="secondary">
- <div>
- <h2 style="text-align:center;">UnchainedTech</h2>
- <h4 style="text-align:center;"><?= l("Drafts List", "Liste des brouillons") ?></h4>
-
- <small><p style="text-align: center;">
- v<?= trim(file_get_contents("/mnt/blogchain/version.txt")) ?> • <a href="#" onclick="document.getElementById('main').style.display='flex';document.getElementById('secondary').style.display='none';"><?= l("Hide drafts list", "Masquer la liste des brouillons") ?></a>
- </p></small>
-
- <ul class="list-group">
- <?php
-
- $drafts = false;
- foreach (scandir("/mnt/blogchain/_posts/_drafts") as $draft) {
- if ($draft !== "." && $draft !== ".." && $draft !== ".gitkeep" && $draft !== "_template.md") {
- $drafts = true;
- echo('<li class="list-group-item">' . substr($draft, 0, -3) . '<span style="float:right;"><a href="https://unchainedtech.minteck.ro.lt/admin/article/' . substr($draft, 0, -3) . '" target="_blank">' . l("Preview", "Prévisualiser") . '</a> · <a href="https://github.com/Minteck/UnchainedTech-Content/edit/production/_drafts/' . $draft . '" target="_blank">' . l("Edit", "Modifier") . '</a> · <a href="https://github.com/Minteck/UnchainedTech-Content/delete/production/_drafts/' . $draft . '" target="_blank">' . l("Delete", "Supprimer") . '</a></span></li>');
- }
- }
-
- ?>
- </ul>
- </div>
- </div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/uptime.php b/admin/panes/uptime.php deleted file mode 100644 index 199df52..0000000 --- a/admin/panes/uptime.php +++ /dev/null @@ -1,76 +0,0 @@ -<?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("The server has been running for", "Le serveur est en fonctionnement depuis") ?></h2>
-
- <h4 style="text-align:center;" id="uptime">---</h4>
- <!--suppress JSUnresolvedVariable, JSUnresolvedFunction -->
- <script>
- setInterval(() => {
- $.ajax("/admin/api/serverTime.php", {
- success: (data) => {
- document.getElementById("uptime").innerText = data;
- }
- });
- }, 500)
- </script>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item">
- <b><?php
-
- exec("journalctl --disk-usage", $ret);
- $data = trim(implode("\n", $ret));
-
- $val = explode(" ", $data)[6];
- echo($val);
-
- ?></b> <?= l("of data has been collected to ensure easy system maintenance and audit", "de données ont été recueillies pour faciliter la maintenance du système et les audits de sécurité") ?>
- </li>
- <li class="list-group-item" id="logsummary">
- <?= l("Calculating...", "Calcul en cours...") ?>
- </li>
- <!--suppress JSUnresolvedVariable, JSUnresolvedFunction -->
- <script>
- $.ajax("/admin/api/serverLogSummary.php", {
- success: (data) => {
- document.getElementById("logsummary").innerHTML = data;
- },
- error: () => {
- document.getElementById("logsummary").innerText = "<?= l("An error occurred while loading this content, perhaps you don't have permission to access it", "Une erreur s'est produite lors du chargement de ce contenu, peut-être que vous n'avez pas la permission d'y accéder") ?>";
- }
- });
- </script>
- </ul>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file diff --git a/admin/panes/version.php b/admin/panes/version.php deleted file mode 100644 index 8642178..0000000 --- a/admin/panes/version.php +++ /dev/null @@ -1,140 +0,0 @@ -<?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("This server is running", "Ce serveur exécute") ?> <?= php_uname('s') ?> version</h2>
-
- <h4 style="text-align:center;"><?= php_uname('r') . " " . php_uname('v') ?></h4>
-
- <ul class="list-group" style="margin-top:20px;">
- <li class="list-group-item">PHP <?= PHP_VERSION ?></li>
- <li class="list-group-item">Minteck's Space <?= trim(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/version.txt")) ?></li>
- <li class="list-group-item">UnchainedTech <?= trim(file_get_contents("/mnt/blogchain/version.txt")) ?></li>
- <li class="list-group-item">Neutron Cloud <?= trim(file_get_contents("/mnt/minteckrolt-cloud/@BASE/source/api/version")) ?> (<?= trim(file_get_contents("/mnt/minteckrolt-cloud/@BASE/source/api/codename")) ?>)</li>
- <li class="list-group-item">Neutron Copper <?= trim(file_get_contents("/mnt/minteckrolt-cloud/@BASE/source/api/cyclic_version")) ?></li>
- <li class="list-group-item">Neutron Titanium <?= trim(file_get_contents("/mnt/minteckrolt-cloud/@BASE/source/api/jaw_version")) ?></li>
- <li class="list-group-item">
- <?php
-
- $osr = [];
- $lines = explode("\n", file_get_contents("/etc/os-release"));
-
- foreach ($lines as $line) {
- if (trim($line) !== "") {
- $parts = explode("=", $line);
- $osr[$parts[0]] = str_replace("\"", "", $parts[1]);
- }
- }
-
- echo($osr["NAME"] . " " . $osr["VERSION"]);
-
- ?>
- </li>
- <li class="list-group-item">Git <?php exec("git --version", $res);$p = explode(" ", $res[0]);array_shift($p);array_shift($p);echo(implode(" ", $p)) ?></li>
- <li class="list-group-item"><?php
-
- $soft = $_SERVER['SERVER_SOFTWARE'];
-
- if (strpos(strtolower($soft), "apache") !== false) {
- echo(l("Apache HTTP Server", "Serveur HTTP Apache"));
- } else {
- echo("nginx");
- }
-
- ?> <?php
-
- $soft = $_SERVER['SERVER_SOFTWARE'];
-
- if (strpos(strtolower($soft), "apache") !== false) {
- exec("apache2 -v", $res2);$p = explode(" ", $res2[0]);array_shift($p);array_shift($p);$p2 = explode("/", implode(" ", $p));array_shift($p2);echo(implode(" ", $p2));
- } else {
- exec("nginx -v", $res2);$p = explode(" ", $res2[0]);array_shift($p);array_shift($p);$p2 = explode("/", implode(" ", $p));array_shift($p2);echo(implode(" ", $p2));
- }
-
- ?></li>
- </ul>
-
- <ul class="list-group" style="margin-top:20px;">
- <li id="checking" class="list-group-item"><?= l("Checking for updates", "Recherche de mises à jour") ?>...</li>
- <li id="checking2" class="list-group-item" style="display:none;"></li>
- <li id="found" class="list-group-item" style="display:none;">
- <b id="updates-count">0</b> <?= l("package·s have updates available", "paquet·s peuvent être mis à jour") ?>
-
- <details>
- <summary><?= l("View details", "Voir les détails") ?></summary>
- <ul class="list-group" id="updates-list"></ul>
- </details>
- </li>
- </ul>
- <!--suppress JSUnresolvedVariable, JSUnresolvedFunction, JSUnfilteredForInLoop -->
- <script>
- $.ajax("/admin/api/refreshUpdates.php", {
- success: (data) => {
- document.getElementById("checking").innerText = "<?= l("Checking for Ubuntu upgrades", "Recherche de mises à niveau d'Ubuntu") ?>...";
- $.ajax("/admin/api/getUbuntuUpgrades.php", {
- success: (data) => {
- document.getElementById("checking").innerHTML = data;
- document.getElementById("checking2").style.display = "";
- document.getElementById("checking2").innerText = "<?= l("Reading package lists", "Lecture des listes de paquets") ?>...";
- $.ajax("/admin/api/getUpdates.php", {
- success: (data) => {
- document.getElementById("checking2").innerText = "<?= l("Please wait", "Patientez") ?>...";
- document.getElementById("updates-count").innerText = data.count;
-
- dom = "";
- for (let index in data.packages) {
- item = data.packages[index];
- dom += `<li class="list-group-item"><b>${item.name}</b> (<span style="color: orange;">${item.version.local}</span> → <span style="color: green;">${item.version.remote}</span>)<br><?= l("Provided by", "Fourni par ") ?>: <code>${item.repos}</code>, <?= l("target architecture", "architecture cible ") ?>: <code>${item.architecture}</code></li>`
- }
-
- document.getElementById("updates-list").innerHTML = dom;
-
- document.getElementById("checking2").outerHTML = "";
- document.getElementById("found").style.display = "";
- },
- error: () => {
- document.getElementById("checking2").innerText = "<?= l("An error occurred while loading this content, perhaps you don't have permission to access it", "Une erreur s'est produite lors du chargement de ce contenu, peut-être que vous n'avez pas la permission d'y accéder") ?>";
- }
- });
- },
- error: () => {
- document.getElementById("checking").innerText = "<?= l("An error occurred while loading this content, perhaps you don't have permission to access it", "Une erreur s'est produite lors du chargement de ce contenu, peut-être que vous n'avez pas la permission d'y accéder") ?>";
- }
- });
- },
- error: () => {
- document.getElementById("checking").innerText = "<?= l("An error occurred while loading this content, perhaps you don't have permission to access it", "Une erreur s'est produite lors du chargement de ce contenu, peut-être que vous n'avez pas la permission d'y accéder") ?>";
- }
- });
- </script>
-</div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/footer.php"; ?>
\ No newline at end of file |