You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hestiacp/web/list/stats/index.php

38 lines
1.1 KiB

1 year ago
<?php
use function Hestiacp\quoteshellarg\quoteshellarg;
$TAB = "STATS";
// Main include
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
// Data
if ($_SESSION["userContext"] === "admin" && !isset($_SESSION["look"])) {
if (empty($_GET["user"])) {
exec(HESTIA_CMD . "v-list-users-stats json", $output, $return_var);
$data = json_decode(implode("", $output), true);
$data = array_reverse($data, true);
unset($output);
} else {
$v_user = quoteshellarg($_GET["user"]);
exec(HESTIA_CMD . "v-list-user-stats $v_user json", $output, $return_var);
$data = json_decode(implode("", $output), true);
$data = array_reverse($data, true);
unset($output);
}
exec(HESTIA_CMD . "v-list-sys-users 'json'", $output, $return_var);
$users = json_decode(implode("", $output), true);
unset($output);
} else {
exec(HESTIA_CMD . "v-list-user-stats $user json", $output, $return_var);
$data = json_decode(implode("", $output), true);
$data = array_reverse($data, true);
unset($output);
}
// Render page
render_page($user, $TAB, "list_stats");
// Back uri
$_SESSION["back"] = $_SERVER["REQUEST_URI"];