diff options
author | Steven Barth <steven@midlink.org> | 2008-08-22 17:18:36 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-08-22 17:18:36 +0000 |
commit | 9c6a852939c4f16f5d82299ff7b3a10f15ac3db0 (patch) | |
tree | 070f5e179d8205f0d9c0807545f4de20660c1c64 /modules/rpc/luasrc/controller/rpc.lua | |
parent | dcf0f6146fb3beb47b4d677b29be5f13d86ea1e6 (diff) |
Updated XML translation system, fixed some errors with multiline-translations
Thanks: Alina Friedrichsen
Diffstat (limited to 'modules/rpc/luasrc/controller/rpc.lua')
-rw-r--r-- | modules/rpc/luasrc/controller/rpc.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/rpc/luasrc/controller/rpc.lua b/modules/rpc/luasrc/controller/rpc.lua new file mode 100644 index 0000000000..41d4c59f0d --- /dev/null +++ b/modules/rpc/luasrc/controller/rpc.lua @@ -0,0 +1,31 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.org> +Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- +module("luci.controller.rpc", package.seeall) + +function index() + entry({"rpc", "uci"}, call("rpc_uci")).sysauth = "root" + entry({"rpc", "auth"}, call("rpc_auth")) +end + +function rpc_proxy(tbl, jsonrpc, method, params, id) + local res = {luci.util.copcall(tbl[function], ...)} + local stat = table.remove(res, 1) + + if not stat then + return nil, {code=-32602, message="Invalid params.", data=table.remove(res, 1)} + else + return res, nil + end +end
\ No newline at end of file |