diff options
author | Florian Eckert <fe@dev.tdt.de> | 2018-01-11 13:31:50 +0100 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2018-01-11 14:46:39 +0100 |
commit | 5aeeb69f15de71fe418d65ca13a73a96c7b6e393 (patch) | |
tree | a7877e905204764d8385555990d3138927bf1382 /applications/luci-app-mwan3/luasrc/model | |
parent | 7b1725566c5de238c1cf787ee369e453291e91e6 (diff) |
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 <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-mwan3/luasrc/model')
3 files changed, 0 insertions, 96 deletions
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 e0a99e8366..0000000000 --- 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 b93d89751b..0000000000 --- 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 95e9f7c7e5..0000000000 --- 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 |