luci-0.8: merge r4734

This commit is contained in:
Jo-Philipp Wich 2009-05-30 22:39:30 +00:00
parent a89c1fa5d2
commit a37d9f8d34

View file

@ -20,9 +20,7 @@ end
function action_activate()
local ip = luci.http.getenv("REMOTE_ADDR") or "127.0.0.1"
local mac = luci.sys.net.ip4mac(
ip:match("::") and (ip:gsub("^%[::ffff:(.+)%]", "%1")) or ip
)
local mac = luci.sys.net.ip4mac(ip:match("^[\[::ffff:]*(%d+.%d+%.%d+%.%d+)\]*$"))
if mac and luci.http.formvalue("accept") then
os.execute("luci-splash add "..mac.." >/dev/null 2>&1")
luci.http.redirect(luci.model.uci.cursor():get("freifunk", "community", "homepage"))