From 5aeeb69f15de71fe418d65ca13a73a96c7b6e393 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 11 Jan 2018 13:31:50 +0100 Subject: luci-app-mwan3: remove direct configuration possibility for /etc/config files With this change it is not longer possible to edit the following configuration files directly. - mwan3 - wireless - network The user should edit the configuration over the provided luci pages. which will do input checks and so prevent from miss configuration. Signed-off-by: Florian Eckert --- .../luci-app-mwan3/luasrc/controller/mwan3.lua | 10 ------- .../luasrc/model/cbi/mwan/advanced_mwanconfig.lua | 32 ---------------------- .../model/cbi/mwan/advanced_networkconfig.lua | 32 ---------------------- .../model/cbi/mwan/advanced_wirelessconfig.lua | 32 ---------------------- .../luasrc/view/mwan/advanced_mwanconfig.htm | 11 -------- .../luasrc/view/mwan/advanced_networkconfig.htm | 11 -------- .../luasrc/view/mwan/advanced_wirelessconfig.htm | 11 -------- 7 files changed, 139 deletions(-) delete mode 100644 applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_mwanconfig.lua delete mode 100644 applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_networkconfig.lua delete mode 100644 applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_wirelessconfig.lua delete mode 100644 applications/luci-app-mwan3/luasrc/view/mwan/advanced_mwanconfig.htm delete mode 100644 applications/luci-app-mwan3/luasrc/view/mwan/advanced_networkconfig.htm delete mode 100644 applications/luci-app-mwan3/luasrc/view/mwan/advanced_wirelessconfig.htm (limited to 'applications') diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua index 59d77966a..e8c818ee3 100644 --- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua +++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua @@ -56,16 +56,6 @@ function index() entry({"admin", "network", "mwan", "configuration", "notify"}, cbi("mwan/notify"), _("Notification"), 50).leaf = true - - entry({"admin", "network", "mwan", "advanced"}, - alias("admin", "network", "mwan", "advanced", "mwanconfig"), - _("Advanced"), 100) - entry({"admin", "network", "mwan", "advanced", "mwanconfig"}, - form("mwan/advanced_mwanconfig")) - entry({"admin", "network", "mwan", "advanced", "networkconfig"}, - form("mwan/advanced_networkconfig")) - entry({"admin", "network", "mwan", "advanced", "wirelessconfig"}, - form("mwan/advanced_wirelessconfig")) end function getInterfaceStatus(ruleNumber, interfaceName) diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_mwanconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_mwanconfig.lua deleted file mode 100644 index e0a99e836..000000000 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_mwanconfig.lua +++ /dev/null @@ -1,32 +0,0 @@ --- ------ mwan configuration ------ -- - -ut = require "luci.util" - -mwanConfig = "/etc/config/mwan3" - - -m5 = SimpleForm("luci", nil) - m5:append(Template("mwan/advanced_mwanconfig")) -- highlight current tab - - -f = m5:section(SimpleSection, nil, - translate("This section allows you to modify the contents of /etc/config/mwan3")) - -t = f:option(TextValue, "lines") - t.rmempty = true - t.rows = 20 - - function t.cfgvalue() - return nixio.fs.readfile(mwanConfig) or "" - end - - function t.write(self, section, data) -- format and write new data to script - return nixio.fs.writefile(mwanConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n") - end - - function f.handle(self, state, data) - return true - end - - -return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_networkconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_networkconfig.lua deleted file mode 100644 index b93d89751..000000000 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_networkconfig.lua +++ /dev/null @@ -1,32 +0,0 @@ --- ------ network configuration ------ -- - -ut = require "luci.util" - -networkConfig = "/etc/config/network" - - -m5 = SimpleForm("networkconf", nil) - m5:append(Template("mwan/advanced_networkconfig")) -- highlight current tab - - -f = m5:section(SimpleSection, nil, - translate("This section allows you to modify the contents of /etc/config/network")) - -t = f:option(TextValue, "lines") - t.rmempty = true - t.rows = 20 - - function t.cfgvalue() - return nixio.fs.readfile(networkConfig) or "" - end - - function t.write(self, section, data) -- format and write new data to script - return nixio.fs.writefile(networkConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n") - end - - function f.handle(self, state, data) - return true - end - - -return m5 diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_wirelessconfig.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_wirelessconfig.lua deleted file mode 100644 index 95e9f7c7e..000000000 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_wirelessconfig.lua +++ /dev/null @@ -1,32 +0,0 @@ --- ------ wireless configuration ------ -- - -ut = require "luci.util" - -wirelessConfig = "/etc/config/wireless" - - -m5 = SimpleForm("wirelessconf", nil) - m5:append(Template("mwan/advanced_wirelessconfig")) -- highlight current tab - - -f = m5:section(SimpleSection, nil, - translate("This section allows you to modify the contents of /etc/config/wireless")) - -t = f:option(TextValue, "lines") - t.rmempty = true - t.rows = 20 - - function t.cfgvalue() - return nixio.fs.readfile(wirelessConfig) or "" - end - - function t.write(self, section, data) -- format and write new data to script - return nixio.fs.writefile(wirelessConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n") - end - - function f.handle(self, state, data) - return true - end - - -return m5 diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_mwanconfig.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_mwanconfig.htm deleted file mode 100644 index da73f234d..000000000 --- a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_mwanconfig.htm +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_networkconfig.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_networkconfig.htm deleted file mode 100644 index 329532827..000000000 --- a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_networkconfig.htm +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_wirelessconfig.htm b/applications/luci-app-mwan3/luasrc/view/mwan/advanced_wirelessconfig.htm deleted file mode 100644 index 10a0eafc1..000000000 --- a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_wirelessconfig.htm +++ /dev/null @@ -1,11 +0,0 @@ - - - -- cgit v1.2.3