Merge pull request #3517 from Ansuel/ubus_short
[oweals/luci.git] / modules / luci-base / luasrc / dispatcher.lua
index d4293422b5d92bbadce0a1794ac9204e45a39906..48e125e4ae5cda3a890e302d93502c6f555b5b39 100644 (file)
@@ -305,7 +305,7 @@ local function tree_to_json(node, json)
                                elseif subname == "rpc" and subnode.module == "luci.controller.rpc" then
                                        spec.auth = {
                                                login = false,
-                                               methods = { "param:auth", "cookie:sysauth" }
+                                               methods = { "query:auth", "cookie:sysauth" }
                                        }
                                elseif subnode.module == "luci.controller.admin.uci" then
                                        spec.auth = {
@@ -546,6 +546,8 @@ local function check_authentication(method)
                sid = http.getcookie(auth_param)
        elseif auth_type == "param" then
                sid = http.formvalue(auth_param)
+       elseif auth_type == "query" then
+               sid = http.formvalue(auth_param, true)
        end
 
        return session_retrieve(sid)
@@ -621,6 +623,14 @@ local function merge_trees(node_a, node_b)
                        node_a[k] = v
                end
        end
+
+       if type(node_a.action) == "table" and
+          node_a.action.type == "firstchild" and
+          node_a.children == nil
+       then
+               node_a.satisfied = false
+       end
+
        return node_a
 end