From c40dc747d3dbfe6c62b673d21ef9c7440aad5d65 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Tue, 5 Nov 2024 18:35:01 +0200 Subject: [PATCH] Removes old code --- app/pages/config.php | 40 +++++++++++++--------------- app/templates/config-host-delete.php | 1 - 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/app/pages/config.php b/app/pages/config.php index d9d5a2c..75d715b 100644 --- a/app/pages/config.php +++ b/app/pages/config.php @@ -154,7 +154,6 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { // FIXME the new file is not loaded on first page load unset($config); -// header("Location: $app_root?platform=$platform_id&page=config"); header("Location: $app_root?page=config&item=$item"); exit(); @@ -199,26 +198,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { break; case 'endpoint': - // TODO - break; - - case 'config_file': - if (isset($action) && $action === 'edit') { - include '../app/templates/config-configfile-edit.php'; - } else { - if ($userObject->hasRight($user_id, 'view config file')) { - include '../app/templates/config-configfile.php'; - } else { - include '../app/templates/error-unauthorized.php'; - } - } - break; - - default: - // the default config page is the platforms page - header("Location: $app_root?page=config&item=platform"); - exit(); - + // TODO ad here endpoints options // switch ($action) { // case 'add-agent': // $jilo_agent_types = $agentObject->getAgentTypes(); @@ -240,6 +220,24 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { // } // break; // } + break; + + case 'config_file': + if (isset($action) && $action === 'edit') { + include '../app/templates/config-configfile-edit.php'; + } else { + if ($userObject->hasRight($user_id, 'view config file')) { + include '../app/templates/config-configfile.php'; + } else { + include '../app/templates/error-unauthorized.php'; + } + } + break; + + default: + // the default config page is the platforms page + header("Location: $app_root?page=config&item=platform"); + exit(); } } diff --git a/app/templates/config-host-delete.php b/app/templates/config-host-delete.php index a40f4ac..809e53a 100644 --- a/app/templates/config-host-delete.php +++ b/app/templates/config-host-delete.php @@ -7,7 +7,6 @@
$value) { -// if ($key === 'id') continue; ?>