summaryrefslogtreecommitdiffhomepage
path: root/modules/rpc
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-22 17:18:36 +0000
committerSteven Barth <steven@midlink.org>2008-08-22 17:18:36 +0000
commit9c6a852939c4f16f5d82299ff7b3a10f15ac3db0 (patch)
tree070f5e179d8205f0d9c0807545f4de20660c1c64 /modules/rpc
parentdcf0f6146fb3beb47b4d677b29be5f13d86ea1e6 (diff)
Updated XML translation system, fixed some errors with multiline-translations
Thanks: Alina Friedrichsen
Diffstat (limited to 'modules/rpc')
-rw-r--r--modules/rpc/Makefile2
-rw-r--r--modules/rpc/luasrc/controller/rpc.lua31
2 files changed, 33 insertions, 0 deletions
diff --git a/modules/rpc/Makefile b/modules/rpc/Makefile
new file mode 100644
index 000000000..81a96f6a8
--- /dev/null
+++ b/modules/rpc/Makefile
@@ -0,0 +1,2 @@
+include ../../build/config.mk
+include ../../build/module.mk \ No newline at end of file
diff --git a/modules/rpc/luasrc/controller/rpc.lua b/modules/rpc/luasrc/controller/rpc.lua
new file mode 100644
index 000000000..41d4c59f0
--- /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