* luci/splash: fix #92

This commit is contained in:
Jo-Philipp Wich 2008-07-15 22:55:25 +00:00
parent be4147d3d8
commit b0d36c88d9

View file

@ -9,9 +9,9 @@ function index()
end end
function action_dispatch() function action_dispatch()
local mac = luci.sys.net.ip4mac(luci.http.getenv("REMOTE_ADDR")) local mac = luci.sys.net.ip4mac(luci.http.getenv("REMOTE_ADDR")) or ""
local status = luci.sys.execl("luci-splash status "..mac)[1] local status = luci.sys.execl("luci-splash status "..mac)[1]
if status == "whitelisted" or status == "lease" then if #mac > 0 and ( status == "whitelisted" or status == "lease" ) then
luci.http.redirect(luci.dispatcher.build_url()) luci.http.redirect(luci.dispatcher.build_url())
else else
luci.http.redirect(luci.dispatcher.build_url("splash", "splash", "splash")) luci.http.redirect(luci.dispatcher.build_url("splash", "splash", "splash"))