summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2018-01-11 13:31:50 +0100
committerFlorian Eckert <fe@dev.tdt.de>2018-01-11 14:46:39 +0100
commit5aeeb69f15de71fe418d65ca13a73a96c7b6e393 (patch)
treea7877e905204764d8385555990d3138927bf1382 /applications
parent7b1725566c5de238c1cf787ee369e453291e91e6 (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')
-rw-r--r--applications/luci-app-mwan3/luasrc/controller/mwan3.lua10
-rw-r--r--applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_mwanconfig.lua32
-rw-r--r--applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_networkconfig.lua32
-rw-r--r--applications/luci-app-mwan3/luasrc/model/cbi/mwan/advanced_wirelessconfig.lua32
-rw-r--r--applications/luci-app-mwan3/luasrc/view/mwan/advanced_mwanconfig.htm11
-rw-r--r--applications/luci-app-mwan3/luasrc/view/mwan/advanced_networkconfig.htm11
-rw-r--r--applications/luci-app-mwan3/luasrc/view/mwan/advanced_wirelessconfig.htm11
7 files changed, 0 insertions, 139 deletions
diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
index 59d77966a5..e8c818ee3d 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 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
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 da73f234dc..0000000000
--- a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_mwanconfig.htm
+++ /dev/null
@@ -1,11 +0,0 @@
-<ul class="cbi-tabmenu">
- <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
-</ul>
-
-<style type="text/css">
- .cbi-section {
- padding: 20px;
- }
-</style>
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 3295328276..0000000000
--- a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_networkconfig.htm
+++ /dev/null
@@ -1,11 +0,0 @@
-<ul class="cbi-tabmenu">
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
- <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
-</ul>
-
-<style type="text/css">
- .cbi-section {
- padding: 20px;
- }
-</style>
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 10a0eafc16..0000000000
--- a/applications/luci-app-mwan3/luasrc/view/mwan/advanced_wirelessconfig.htm
+++ /dev/null
@@ -1,11 +0,0 @@
-<ul class="cbi-tabmenu">
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
- <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
- <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
-</ul>
-
-<style type="text/css">
- .cbi-section {
- padding: 20px;
- }
-</style>