aboutsummaryrefslogtreecommitdiff
path: root/admin/api/getQuota.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-01-01 10:37:28 +0100
committerMinteck <contact@minteck.org>2022-01-01 10:37:28 +0100
commitef055e79855cf3be1ad5e1aa5f9ebad480062384 (patch)
treeff074b29a7a87c3ccfc3b10741bbe30cb28e103e /admin/api/getQuota.php
parente3a79df6428799024eac64e9cffbb062317aeb95 (diff)
downloadmain-trunk.tar.gz
main-trunk.tar.bz2
main-trunk.zip
Bye furriesHEADtrunk
Diffstat (limited to 'admin/api/getQuota.php')
-rw-r--r--admin/api/getQuota.php54
1 files changed, 0 insertions, 54 deletions
diff --git a/admin/api/getQuota.php b/admin/api/getQuota.php
deleted file mode 100644
index 1d64737..0000000
--- a/admin/api/getQuota.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php";
-
-if (isset($_GET['_']) && strpos($_GET['_'], "/") === false) {
- $arg = $_GET['_'];
-} else {
- die();
-}
-
-$webs = scandir("/mnt/minteckrolt-cloud");
-
-if (in_array($arg, $webs)) {
- $tier = trim(file_get_contents("/mnt/minteckrolt-cloud/" . $arg . "/Tier"));
-
- exec("du -hs /mnt/minteckrolt-cloud/" . $arg, $ret);
- $parts = explode(" ", $ret[0]);
-
- exec("du -s /mnt/minteckrolt-cloud/" . $arg, $ret2);
- $parts2 = explode(" ", $ret2[0]);
-
- if ($tier === "3") {
- $perc = ($parts2[0] / 100000) * 100;
- if ($perc > 75) {
- die("<span class='text-danger'>" . l("Using", "Utilise") . " " . $parts[0] . "/100M (" . round($perc, 2) . "%)</span>");
- } else if ($perc > 50) {
- die("<span class='text-warning'>" . l("Using", "Utilise") . " " . $parts[0] . "/100M (" . round($perc, 2) . "%)</span>");
- } else {
- die("<span class='text-success'>" . l("Using", "Utilise") . " " . $parts[0] . "/100M (" . round($perc, 2) . "%)</span>");
- }
- } else if ($tier === "5") {
- $perc = ($parts2[0] / 250000) * 100;
- if ($perc > 75) {
- die("<span class='text-danger'>" . l("Using", "Utilise") . " " . $parts[0] . "/250M (" . round($perc, 2) . "%)</span>");
- } else if ($perc > 50) {
- die("<span class='text-warning'>" . l("Using", "Utilise") . " " . $parts[0] . "/250M (" . round($perc, 2) . "%)</span>");
- } else {
- die("<span class='text-success'>" . l("Using", "Utilise") . " " . $parts[0] . "/250M (" . round($perc, 2) . "%)</span>");
- }
- } else if ($tier === "7") {
- $perc = ($parts2[0] / 500000) * 100;
- if ($perc > 75) {
- die("<span class='text-danger'>" . l("Using", "Utilise") . " " . $parts[0] . "/500M (" . round($perc, 2) . "%)</span>");
- } else if ($perc > 50) {
- die("<span class='text-warning'>" . l("Using", "Utilise") . " " . $parts[0] . "/500M (" . round($perc, 2) . "%)</span>");
- } else {
- die("<span class='text-success'>" . l("Using", "Utilise") . " " . $parts[0] . "/500M (" . round($perc, 2) . "%)</span>");
- }
- } else {
- die("<span class='text-success'>" . l("Using", "Utilise") . " " . $parts[0] . "</span>");
- }
-}
-
-die("Unable to calculate data usage"); \ No newline at end of file