From f52ec227175c9db1bfee95f8a59c7c56d01911d4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 8 Feb 2009 03:56:50 +0000 Subject: modules/admin-full: implement iptables status page i18n/english: resync xml, add strings for iptables page libs/sys/iptparser: implement chain() and is_custom_target() --- modules/admin-full/luasrc/controller/admin/status.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'modules/admin-full/luasrc/controller/admin/status.lua') diff --git a/modules/admin-full/luasrc/controller/admin/status.lua b/modules/admin-full/luasrc/controller/admin/status.lua index 09e7766c1f..fd61459e99 100644 --- a/modules/admin-full/luasrc/controller/admin/status.lua +++ b/modules/admin-full/luasrc/controller/admin/status.lua @@ -19,7 +19,8 @@ function index() entry({"admin", "status"}, template("admin_status/index"), i18n("status", "Status"), 20).index = true entry({"admin", "status", "syslog"}, call("action_syslog"), i18n("syslog", "Systemprotokoll"), 1) - entry({"admin", "status", "dmesg"}, call("action_dmesg"), i18n("dmesg", "Kernelprotokoll"), 2) + entry({"admin", "status", "dmesg"}, call("action_dmesg"), i18n("dmesg", "Kernelprotokoll"), 2) + entry({"admin", "status", "iptables"}, call("action_iptables"), i18n("a_s_ipt", "Firewall"), 3) end function action_syslog() @@ -31,3 +32,19 @@ function action_dmesg() local dmesg = luci.sys.dmesg() luci.template.render("admin_status/dmesg", {dmesg=dmesg}) end + +function action_iptables() + if luci.http.formvalue("zero") == "1" then + luci.util.exec("iptables -Z") + luci.http.redirect( + luci.dispatcher.build_url("admin", "status", "iptables") + ) + elseif luci.http.formvalue("restart") == "1" then + luci.util.exec("/etc/init.d/firewall restart") + luci.http.redirect( + luci.dispatcher.build_url("admin", "status", "iptables") + ) + else + luci.template.render("admin_status/iptables") + end +end -- cgit v1.2.3