From 065b392b34add449e8ffdc624f15a347b95dfc5d Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 23 May 2012 16:47:27 +0200 Subject: [PATCH] Make wizard behave friendly when luci-admin is installed --- .../usr/lib/lua/luci/controller/ffhl/index.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/luci/config-mode/files/usr/lib/lua/luci/controller/ffhl/index.lua b/luci/config-mode/files/usr/lib/lua/luci/controller/ffhl/index.lua index c042f9c..49f3d25 100644 --- a/luci/config-mode/files/usr/lib/lua/luci/controller/ffhl/index.lua +++ b/luci/config-mode/files/usr/lib/lua/luci/controller/ffhl/index.lua @@ -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