summaryrefslogtreecommitdiffhomepage
path: root/libs/web
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-07-17 16:02:29 +0000
committerSteven Barth <steven@midlink.org>2008-07-17 16:02:29 +0000
commit52d49762ed28033d82e5ab1e0ccf65ad74a4b593 (patch)
tree61ba5cc4a6a1cebfff038e815bea7f001fab305a /libs/web
parent8d1aff78b17d6f7437d776bdf53a6aa2112f31db (diff)
applications/luci-qos: Smaller enhancements, support for luci-mini
applications/luci-fw: Fixed support for luci-mini libs/web: Removed luci.dispatcher.registered
Diffstat (limited to 'libs/web')
-rw-r--r--libs/web/luasrc/dispatcher.lua25
1 files changed, 10 insertions, 15 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua
index 756f3cc7d..e44519a3f 100644
--- a/libs/web/luasrc/dispatcher.lua
+++ b/libs/web/luasrc/dispatcher.lua
@@ -141,6 +141,14 @@ function dispatch(request)
viewns.resource = luci.config.main.resourcebase
viewns.REQUEST_URI = luci.http.getenv("SCRIPT_NAME") .. (luci.http.getenv("PATH_INFO") or "")
+ if track.dependent then
+ local stat, err = pcall(assert, not track.auto)
+ if not stat then
+ error500(err)
+ return
+ end
+ end
+
if track.sysauth then
require("luci.sauth")
local def = (type(track.sysauth) == "string") and track.sysauth
@@ -324,20 +332,6 @@ function entry(path, target, title, order)
return c
end
--- Checks whether a node exists
-function registered(...)
- local c = context.tree
-
- for k,v in ipairs(arg) do
- if not c.nodes[v] then
- return false
- end
-
- c = c.nodes[v]
- end
- return true
-end
-
-- Fetch a dispatching node
function node(...)
local c = context.tree
@@ -345,7 +339,7 @@ function node(...)
for k,v in ipairs(arg) do
if not c.nodes[v] then
- c.nodes[v] = {nodes={}}
+ c.nodes[v] = {nodes={}, auto=true}
end
c = c.nodes[v]
@@ -353,6 +347,7 @@ function node(...)
c.module = getfenv(2)._NAME
c.path = arg
+ c.auto = nil
return c
end