diff --git a/web/list/package/index.php b/web/list/package/index.php index 2f62be12..297e0485 100644 --- a/web/list/package/index.php +++ b/web/list/package/index.php @@ -5,6 +5,12 @@ $TAB = 'PACKAGE'; // Main include include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); +// Check user +if ($_SESSION['user'] != 'admin') { + header("Location: /list/user"); + exit; +} + // Header include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); @@ -12,13 +18,10 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); top_panel($user,$TAB); // Data -if ($_SESSION['user'] == 'admin') { - exec (VESTA_CMD."v-list-user-packages json", $output, $return_var); - $data = json_decode(implode('', $output), true); - //$data = array_reverse($data, true); - unset($output); - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_packages.html'); -} +exec (VESTA_CMD."v-list-user-packages json", $output, $return_var); +$data = json_decode(implode('', $output), true); +unset($output); +include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_packages.html'); // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI'];