From 340b3d7301d81ed46af261d8c948f0e77e052243 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Jul 2005 03:59:25 +0000 Subject: r8575: the beginnings of a smbstatus command (This used to be commit 4ecaf72a31cde2722315a61cbe823d44f0c14586) --- source4/scripting/libjs/management.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 source4/scripting/libjs/management.js (limited to 'source4/scripting/libjs') diff --git a/source4/scripting/libjs/management.js b/source4/scripting/libjs/management.js new file mode 100644 index 0000000000..371ddc026b --- /dev/null +++ b/source4/scripting/libjs/management.js @@ -0,0 +1,33 @@ +/* + backend code for Samba4 management + Copyright Andrew Tridgell 2005 + Released under the GNU GPL v2 or later +*/ + +/* + return a list of current sessions +*/ +function smbsrv_sessions() +{ + var conn = new Object(); + var irpc = irpc_init(); + status = irpc_connect(conn, "smb_server"); + assert(status.is_ok == true); + + var io = irpcObj(); + io.input.level = irpc.SMBSRV_INFO_SESSIONS; + status = irpc.smbsrv_information(conn, io); + + /* gather the results into a single array */ + var i, count=0, ret = new Object(); + for (i=0;i