From efc958fbf85755a400bb6ad321dd1ad2f50f2bb6 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 21 Jan 2014 06:13:25 +0100 Subject: [PATCH] gluon-luci-admin: disable when not in configmode For security reasons we'd like to disable all HTTP config interfaces when the node is operating normally. This patch disables gluon-luci-admin when configmode is not enabled. --- .../files/usr/lib/lua/luci/controller/admin/index.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/gluon-luci-admin/files/usr/lib/lua/luci/controller/admin/index.lua b/package/gluon-luci-admin/files/usr/lib/lua/luci/controller/admin/index.lua index 8e91fd6d..1bf4d155 100644 --- a/package/gluon-luci-admin/files/usr/lib/lua/luci/controller/admin/index.lua +++ b/package/gluon-luci-admin/files/usr/lib/lua/luci/controller/admin/index.lua @@ -19,6 +19,11 @@ function index() local uci_state = luci.model.uci.cursor_state() local configmode = uci_state:get_first("gluon-config-mode", "wizard", "running", "0") == "1" + -- Disable gluon-luci-admin when configmode is not enabled + if not configmode then + return + end + local root = node() if not root.lock then root.target = alias("admin")