Make wizard behave friendly when luci-admin is installed

This commit is contained in:
Nils Schneider 2012-05-23 16:47:27 +02:00 committed by Matthias Schiffer
parent a75833cd29
commit 065b392b34
1 changed files with 9 additions and 7 deletions

View File

@ -1,12 +1,14 @@
module("luci.controller.ffhl.index", package.seeall)
function index()
entry({}, call("maybe_wizard"), "luebeck.freifunk.net", 20).dependent=false
local uci = luci.model.uci.cursor()
if uci:get_first("ffhl", "wizard", "enabled") == "1" then
local root = node()
if not root.target then
root.target = alias("wizard", "welcome")
root.index = true
end
end
end
function maybe_wizard()
-- This function should figure out whether the wizard already ran succesfully
-- and redirect to the wizard or the status page.
luci.http.redirect(luci.dispatcher.build_url("wizard", "welcome"))
end