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/api/getQuota.php | |
parent | e3a79df6428799024eac64e9cffbb062317aeb95 (diff) | |
download | main-trunk.tar.gz main-trunk.tar.bz2 main-trunk.zip |
Diffstat (limited to 'admin/api/getQuota.php')
-rw-r--r-- | admin/api/getQuota.php | 54 |
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 |