From 6604399aa8f35d33c53a5e5a1fea765f401aef5e Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 22 May 2008 14:04:03 +0000 Subject: Merge branch 'menu' --- .../luci-splash/src/controller/splash/splash.lua | 13 +++++++++- .../src/model/cbi/admin_services/splash.lua | 30 ---------------------- .../luci-splash/src/model/cbi/splash/splash.lua | 30 ++++++++++++++++++++++ .../luci-splash/src/model/menu/50luci-splash.lua | 2 -- 4 files changed, 42 insertions(+), 33 deletions(-) delete mode 100644 applications/luci-splash/src/model/cbi/admin_services/splash.lua create mode 100644 applications/luci-splash/src/model/cbi/splash/splash.lua delete mode 100644 applications/luci-splash/src/model/menu/50luci-splash.lua (limited to 'applications/luci-splash') diff --git a/applications/luci-splash/src/controller/splash/splash.lua b/applications/luci-splash/src/controller/splash/splash.lua index 62088be52d..7d837cd34d 100644 --- a/applications/luci-splash/src/controller/splash/splash.lua +++ b/applications/luci-splash/src/controller/splash/splash.lua @@ -1,5 +1,16 @@ module("ffluci.controller.splash.splash", package.seeall) +function index() + local page = node("admin", "services", "splash") + page.target = cbi("splash/splash") + page.title = "Client-Splash" + + node("splash", "splash", "activate").target = action_activate + node("splash", "splash", "allowed").target = action_allowed + node("splash", "splash", "unknown").target = action_unknown + node("splash", "splash", "splash").target = template("splash_splash/splash") +end + function action_activate() local mac = ffluci.sys.net.ip4mac(ffluci.http.env.REMOTE_ADDR) if mac and ffluci.http.formvalue("accept") then @@ -10,7 +21,7 @@ function action_activate() end end -function action_accepted() +function action_allowed() ffluci.http.redirect(ffluci.dispatcher.build_url()) end diff --git a/applications/luci-splash/src/model/cbi/admin_services/splash.lua b/applications/luci-splash/src/model/cbi/admin_services/splash.lua deleted file mode 100644 index fe4d2c3ee8..0000000000 --- a/applications/luci-splash/src/model/cbi/admin_services/splash.lua +++ /dev/null @@ -1,30 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -require("ffluci.model.uci") - -m = Map("luci_splash", "Client-Splash", [[Client-Splash ist das Freifunk Hotspot-Authentifizierungs-System.]]) - -s = m:section(NamedSection, "general", "core", "Allgemein") -s:option(Value, "leasetime", "Freigabezeit", "h") - -s = m:section(TypedSection, "iface", "Schnittstellen") -s.addremove = true -s.anonymous = true - -iface = s:option(ListValue, "network", "Schnittstelle") -for k, v in pairs(ffluci.model.uci.sections("network")) do - if v[".type"] == "interface" and k ~= "loopback" then - iface:value(k) - end -end - -s = m:section(TypedSection, "whitelist", "Automatische Freigabe") -s.addremove = true -s.anonymous = true -s:option(Value, "mac", "MAC-Adresse") - -s = m:section(TypedSection, "blacklist", "Automatische Sperrung") -s.addremove = true -s.anonymous = true -s:option(Value, "mac", "MAC-Adresse") - -return m \ No newline at end of file diff --git a/applications/luci-splash/src/model/cbi/splash/splash.lua b/applications/luci-splash/src/model/cbi/splash/splash.lua new file mode 100644 index 0000000000..fe4d2c3ee8 --- /dev/null +++ b/applications/luci-splash/src/model/cbi/splash/splash.lua @@ -0,0 +1,30 @@ +-- ToDo: Translate, Add descriptions and help texts +require("ffluci.model.uci") + +m = Map("luci_splash", "Client-Splash", [[Client-Splash ist das Freifunk Hotspot-Authentifizierungs-System.]]) + +s = m:section(NamedSection, "general", "core", "Allgemein") +s:option(Value, "leasetime", "Freigabezeit", "h") + +s = m:section(TypedSection, "iface", "Schnittstellen") +s.addremove = true +s.anonymous = true + +iface = s:option(ListValue, "network", "Schnittstelle") +for k, v in pairs(ffluci.model.uci.sections("network")) do + if v[".type"] == "interface" and k ~= "loopback" then + iface:value(k) + end +end + +s = m:section(TypedSection, "whitelist", "Automatische Freigabe") +s.addremove = true +s.anonymous = true +s:option(Value, "mac", "MAC-Adresse") + +s = m:section(TypedSection, "blacklist", "Automatische Sperrung") +s.addremove = true +s.anonymous = true +s:option(Value, "mac", "MAC-Adresse") + +return m \ No newline at end of file diff --git a/applications/luci-splash/src/model/menu/50luci-splash.lua b/applications/luci-splash/src/model/menu/50luci-splash.lua deleted file mode 100644 index 99f7caa52b..0000000000 --- a/applications/luci-splash/src/model/menu/50luci-splash.lua +++ /dev/null @@ -1,2 +0,0 @@ -sel("admin", "services") -act("splash", "Client-Splash") \ No newline at end of file -- cgit v1.2.3