Explorar o código

aligned code formating

Serghey Rodin %!s(int64=11) %!d(string=hai) anos
pai
achega
a587c109cd
Modificáronse 1 ficheiros con 10 adicións e 7 borrados
  1. 10 7
      web/list/package/index.php

+ 10 - 7
web/list/package/index.php

@@ -5,6 +5,12 @@ $TAB = 'PACKAGE';
 // Main include
 // Main include
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 
+// Check user
+if ($_SESSION['user'] != 'admin') {
+    header("Location: /list/user");
+    exit;
+}
+
 // Header
 // Header
 include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 
 
@@ -12,13 +18,10 @@ include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
 top_panel($user,$TAB);
 top_panel($user,$TAB);
 
 
 // Data
 // 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
 // Back uri
 $_SESSION['back'] = $_SERVER['REQUEST_URI'];
 $_SESSION['back'] = $_SERVER['REQUEST_URI'];