From 78e123518cbc808424e776751f4112fbaa8b74eb Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Sun, 11 Mar 2007 18:37:45 +0000 Subject: [PATCH] r21788: Add new JSON-RPC services. rafal --- services/samba/config.esp | 26 ++++++++++++++++++ services/samba/ejsnet.esp | 68 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 services/samba/config.esp create mode 100644 services/samba/ejsnet.esp diff --git a/services/samba/config.esp b/services/samba/config.esp new file mode 100644 index 00000000000..bf4b789c13b --- /dev/null +++ b/services/samba/config.esp @@ -0,0 +1,26 @@ +<% + +/* + * Copyright (C) Rafal Szczesniak 2007 + */ + +/* Simple JSON-RPC access to the configuration parameters */ + +function _lp_get(params, error) +{ + if (params.length < 1) + { + error.setError(jsonrpc.Constant.ServerError.ParameterMismatch, + "no parameter specified"); + return error; + } + + var lp = loadparm_init(); + var name = params[0]; + var value = lp.get(name); + + return value; +} +jsonrpc.method.lp_get = _lp_get; + +%> diff --git a/services/samba/ejsnet.esp b/services/samba/ejsnet.esp new file mode 100644 index 00000000000..9584becac6b --- /dev/null +++ b/services/samba/ejsnet.esp @@ -0,0 +1,68 @@ +<% + +/* + * Copyright (C) Rafal Szczesniak 2007 + */ + +/* JSON-RPC mappings to the libnet functions */ + +jsonrpc_include("resources.esp"); + + +function _init_ctx(params, error) +{ + if (params.length < 1) + { + error.setError(jsonrpc.Constant.ServerError.ParameterMismatch, + "too few parameters(usage: [ -- 2.11.4.GIT