diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-06-04 22:41:58 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-06-04 22:41:58 +0000 |
commit | 48e06817daf525eb552e064ac94428297d35941b (patch) | |
tree | 6d68cee885290ac8d41e028f5b84d9c6986a4508 /applications/luci-statistics | |
parent | b871cadf34ed0c78e7619011d44029a1af269b4c (diff) |
* luci/statistics: moving the graph controller to admin caused the images to be generated by the root user which rendered the linked-in public statistics pages unusable because of missing permissions to write the generated graphics as nobody to directories created by root
* luci/core: store the actual dispatching path to .path in node() - this permits dispatcher modules to get the canonical path as luci.dispatcher.dispatched.path
Diffstat (limited to 'applications/luci-statistics')
-rw-r--r-- | applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua b/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua index ae1679bee..df20d58d0 100644 --- a/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua +++ b/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua @@ -70,7 +70,10 @@ function index() -- output views - entry( { "admin", "statistics", "graph" }, call("statistics_index"), _i18n("graphs"), 80).i18n = "statistics" + local page = entry( { "admin", "statistics", "graph" }, call("statistics_index"), _i18n("graphs"), 80) + page.i18n = "statistics" + page.setuser = "nobody" + page.setgroup = "nogroup" local vars = luci.http.formvalues() local span = vars.timespan or nil @@ -142,13 +145,14 @@ function statistics_render() local vars = luci.http.formvalues() local req = luci.dispatcher.request + local path = luci.dispatcher.dispatched.path local uci = luci.model.uci.Session() local spans = luci.util.split( uci:get( "luci_statistics", "collectd_rrdtool", "RRATimespans" ), "%s+", nil, true ) local span = vars.timespan or uci:get( "luci_statistics", "rrdtool", "default_timespan" ) or spans[1] local graph = luci.statistics.rrdtool.Graph( luci.util.parse_units( span ) ) - local plugin = req[4] - local instances = { req[5] } + local plugin = path[4] + local instances = { path[5] } local images = { } -- no instance requested, find all instances |