Files
VestaCP/web/list/server/index.php

136 lines
3.5 KiB
PHP
Raw Normal View History

2013-01-16 01:51:02 +02:00
<?php
2015-11-06 22:54:06 +02:00
error_reporting(NULL);
2015-05-29 01:56:37 +03:00
$TAB = 'SERVER';
2013-01-29 00:18:09 +02:00
// Main include
2013-01-16 01:51:02 +02:00
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
2015-09-09 16:45:09 +03:00
// Check user
if ($_SESSION['user'] != 'admin') {
header("Location: /list/user");
exit;
}
// CPU info
if (isset($_GET['cpu'])) {
$TAB = 'CPU';
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_server_info.html');
exec (VESTA_CMD.'v-list-sys-cpu-status', $output, $return_var);
foreach($output as $file) {
echo $file . "\n";
}
2015-09-09 16:45:09 +03:00
echo " </pre>\n</body>\n</html>\n";
exit();
2015-09-09 16:45:09 +03:00
}
// Memory info
if (isset($_GET['mem'])) {
$TAB = 'MEMORY';
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_server_info.html');
exec (VESTA_CMD.'v-list-sys-memory-status', $output, $return_var);
foreach($output as $file) {
echo $file . "\n";
}
2015-09-09 16:45:09 +03:00
echo " </pre>\n</body>\n</html>\n";
exit();
2015-09-09 16:45:09 +03:00
}
// Disk info
if (isset($_GET['disk'])) {
$TAB = 'MEMORY';
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_server_info.html');
exec (VESTA_CMD.'v-list-sys-disk-status', $output, $return_var);
foreach($output as $file) {
echo $file . "\n";
}
2015-09-09 16:45:09 +03:00
echo " </pre>\n</body>\n</html>\n";
exit();
2015-09-09 16:45:09 +03:00
}
// Network info
if (isset($_GET['net'])) {
$TAB = 'MEMORY';
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_server_info.html');
exec (VESTA_CMD.'v-list-sys-network-status', $output, $return_var);
foreach($output as $file) {
echo $file . "\n";
}
2015-09-09 16:45:09 +03:00
echo " </pre>\n</body>\n</html>\n";
exit();
2015-09-09 16:45:09 +03:00
}
// Web info
if (isset($_GET['web'])) {
$TAB = 'WEB';
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_server_info.html');
exec (VESTA_CMD.'v-list-sys-web-status', $output, $return_var);
foreach($output as $file) {
echo $file . "\n";
}
2015-09-09 16:45:09 +03:00
echo " </pre>\n</body>\n</html>\n";
exit();
2015-09-09 16:45:09 +03:00
}
// DNS info
if (isset($_GET['dns'])) {
$TAB = 'DNS';
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_server_info.html');
exec (VESTA_CMD.'v-list-sys-dns-status', $output, $return_var);
foreach($output as $file) {
echo $file . "\n";
}
2015-09-09 16:45:09 +03:00
echo " </pre>\n</body>\n</html>\n";
exit();
2015-09-09 16:45:09 +03:00
}
// Mail info
if (isset($_GET['mail'])) {
$TAB = 'MAIL';
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_server_info.html');
exec (VESTA_CMD.'v-list-sys-mail-status', $output, $return_var);
if ($return_var == 0 ) {
foreach($output as $file) {
echo $file . "\n";
}
2015-09-09 16:45:09 +03:00
}
echo " </pre>\n</body>\n</html>\n";
exit();
2015-09-09 16:45:09 +03:00
}
// DB info
if (isset($_GET['db'])) {
$TAB = 'DB';
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_server_info.html');
exec (VESTA_CMD.'v-list-sys-db-status', $output, $return_var);
if ($return_var == 0 ) {
foreach($output as $file) {
echo $file . "\n";
}
2015-09-09 16:45:09 +03:00
}
echo " </pre>\n</body>\n</html>\n";
exit();
2015-09-09 16:45:09 +03:00
}
2013-01-16 01:51:02 +02:00
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Data
exec (VESTA_CMD."v-list-sys-info json", $output, $return_var);
$sys = json_decode(implode('', $output), true);
unset($output);
exec (VESTA_CMD."v-list-sys-services json", $output, $return_var);
$data = json_decode(implode('', $output), true);
unset($output);
2015-09-09 16:45:09 +03:00
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_services.html');
2013-01-16 01:51:02 +02:00
2013-01-29 00:18:09 +02:00
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
2013-01-16 01:51:02 +02:00
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');