mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 13:54:28 -07:00
user package listing
This commit is contained in:
parent
29d115b780
commit
650c3f8507
12 changed files with 168 additions and 31 deletions
|
@ -1,34 +1,28 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
session_start();
|
||||
|
||||
// Check user
|
||||
if (!isset($_SESSION['user'])) {
|
||||
header("Location: /login/");
|
||||
}
|
||||
|
||||
// Set vairables
|
||||
date_default_timezone_set('UTC');
|
||||
$user = $_SESSION['user'];
|
||||
$vesta_cmd="/usr/bin/sudo /usr/local/vesta/bin/";
|
||||
$TAB = 'PACKAGES';
|
||||
|
||||
// Define functions
|
||||
require_once '../../inc/main.php';
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Header
|
||||
require_once '../../templates/header.html';
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
|
||||
|
||||
// Top Menu
|
||||
$command = "$vesta_cmd"."v_list_user '".$_SESSION['user']."' 'json'";
|
||||
exec ($command, $output, $return_var);
|
||||
if ( $return_var > 0 ) {
|
||||
header("Location: /error/");
|
||||
}
|
||||
$panel = json_decode(implode('', $output), true);
|
||||
if ( $_SESSION['user'] == 'admin' ) {
|
||||
require_once '../../templates/admin/panel.html';
|
||||
} else {
|
||||
require_once '../../templates/header.html';
|
||||
// Panel
|
||||
top_panel($user,$TAB);
|
||||
|
||||
// Data
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
|
||||
exec (VESTA_CMD."v_list_user_packages json", $output, $return_var);
|
||||
check_error($return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
$data = array_reverse($data);
|
||||
unset($output);
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_packages.html');
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_packages.html');
|
||||
}
|
||||
|
||||
require_once '../../templates/footer.html';
|
||||
// Footer
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue