From 045d9c1942146eb971609b637029911e4802a2e9 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sun, 11 May 2008 10:29:45 +0000 Subject: * DHCP-Splash fixes #1 --- .../luci-splash/src/controller/splash/splash.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 applications/luci-splash/src/controller/splash/splash.lua (limited to 'applications/luci-splash/src/controller/splash/splash.lua') diff --git a/applications/luci-splash/src/controller/splash/splash.lua b/applications/luci-splash/src/controller/splash/splash.lua new file mode 100644 index 0000000000..62088be52d --- /dev/null +++ b/applications/luci-splash/src/controller/splash/splash.lua @@ -0,0 +1,19 @@ +module("ffluci.controller.splash.splash", package.seeall) + +function action_activate() + local mac = ffluci.sys.net.ip4mac(ffluci.http.env.REMOTE_ADDR) + if mac and ffluci.http.formvalue("accept") then + os.execute("luci-splash add "..mac.." >/dev/null 2>&1") + ffluci.http.redirect(ffluci.model.uci.get("freifunk", "community", "homepage")) + else + ffluci.http.redirect(ffluci.dispatcher.build_url()) + end +end + +function action_accepted() + ffluci.http.redirect(ffluci.dispatcher.build_url()) +end + +function action_unknown() + ffluci.http.redirect(ffluci.dispatcher.build_url()) +end \ No newline at end of file -- cgit v1.2.3