X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-splash%2Fsrc%2Fcontroller%2Fsplash%2Fsplash.lua;h=7d837cd34d1dd43c5e1ea8759f641a524b4673bf;hp=62088be52d5e8c3aaf3f2f9ca6ffcb07a6225aa5;hb=6604399aa8f35d33c53a5e5a1fea765f401aef5e;hpb=045d9c1942146eb971609b637029911e4802a2e9 diff --git a/applications/luci-splash/src/controller/splash/splash.lua b/applications/luci-splash/src/controller/splash/splash.lua index 62088be52..7d837cd34 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