Fix unhandled track values for leafs
This commit is contained in:
parent
830ca24abb
commit
20116047b0
1 changed files with 7 additions and 1 deletions
|
@ -125,18 +125,23 @@ function dispatch(request)
|
||||||
local c = context.tree
|
local c = context.tree
|
||||||
local track = {}
|
local track = {}
|
||||||
local args = {}
|
local args = {}
|
||||||
|
context.args = context.path
|
||||||
local n
|
local n
|
||||||
|
|
||||||
for i, s in ipairs(request) do
|
for i, s in ipairs(request) do
|
||||||
c = c.nodes[s]
|
c = c.nodes[s]
|
||||||
n = i
|
n = i
|
||||||
if not c or c.leaf then
|
if not c then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs(c) do
|
for k, v in pairs(c) do
|
||||||
track[k] = v
|
track[k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if c.leaf then
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if c and c.leaf then
|
if c and c.leaf then
|
||||||
|
@ -184,6 +189,7 @@ function dispatch(request)
|
||||||
if authen then
|
if authen then
|
||||||
local user = authen(luci.sys.user.checkpasswd, def)
|
local user = authen(luci.sys.user.checkpasswd, def)
|
||||||
if not user or not luci.util.contains(accs, user) then
|
if not user or not luci.util.contains(accs, user) then
|
||||||
|
luci.http.status(403, "Forbidden")
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
local sid = luci.sys.uniqueid(16)
|
local sid = luci.sys.uniqueid(16)
|
||||||
|
|
Loading…
Reference in a new issue