From 69ac1031b7e83fb68ee1f6f952890fc0654f54f8 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 21 Nov 2012 19:29:47 +0000 Subject: applications/luci-commands, applications/luci-upnp, modules/admin-core, modules/admin-full, modules/freifunk: clean up argument handling of leaf nodes --- applications/luci-commands/luasrc/controller/commands.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'applications/luci-commands/luasrc') diff --git a/applications/luci-commands/luasrc/controller/commands.lua b/applications/luci-commands/luasrc/controller/commands.lua index 9fbde94c6a..c04d186bb4 100644 --- a/applications/luci-commands/luasrc/controller/commands.lua +++ b/applications/luci-commands/luasrc/controller/commands.lua @@ -141,9 +141,7 @@ local function parse_args(str) end local function parse_cmdline(cmdid, args) - local uci = require "luci.model.uci".cursor() - local path = luci.dispatcher.context.requestpath - + local uci = require "luci.model.uci".cursor() if uci:get("luci", cmdid) == "command" then local cmd = uci:get_all("luci", cmdid) local argv = parse_args(cmd.command) @@ -228,7 +226,8 @@ end function action_public(cmdid, args) local uci = require "luci.model.uci".cursor() - if uci:get("luci", cmdid) == "command" and + if cmdid and + uci:get("luci", cmdid) == "command" and uci:get("luci", cmdid, "public") == "1" then action_download(cmdid, args) -- cgit v1.2.3