summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-10-11 11:30:43 +0000
committerSteven Barth <steven@midlink.org>2008-10-11 11:30:43 +0000
commitd97b73c8c03137c4cf4842f2f5c25940f4fc3246 (patch)
tree3aeb392634ddfdad70260ca38324a91c5279a285 /libs
parentb618361bf1c7ea160f3e0ef18aa8f409f7a21eff (diff)
OXYGEN #4: Fixed indexing support in dispatcher
Diffstat (limited to 'libs')
-rw-r--r--libs/web/luasrc/dispatcher.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua
index d03b2ec37..5a9a0c6f5 100644
--- a/libs/web/luasrc/dispatcher.lua
+++ b/libs/web/luasrc/dispatcher.lua
@@ -232,16 +232,20 @@ function dispatch(request)
luci.sys.process.setuser(track.setuser)
end
+ if c and (c.index or type(c.target) == "function") then
+ ctx.dispatched = c
+ ctx.requested = ctx.requested or ctx.dispatched
+ end
+
if c and c.index then
local tpl = require "luci.template"
- if util.copcall(tpl.render, "indexer") then
+
+ if util.copcall(tpl.render, "indexer", {}) then
return true
end
end
if c and type(c.target) == "function" then
- context.dispatched = c
-
util.copcall(function()
local oldenv = getfenv(c.target)
local module = require(c.module)