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
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
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]
c.module = getfenv(2)._NAME
c.path = arg
+ c.auto = nil
return c
end