pidl/python: Fix compilation of py_echo.
[samba.git] / source4 / scripting / libjs / management.js
index 26c1c0a34a65539090348117aae9b1e883621b4c..e54b5e283bed08d0d007bfd54e639873b6a8e251 100644 (file)
@@ -24,7 +24,7 @@ function smbsrv_sessions()
        }
 
        /* gather the results into a single array */
-       var i, count=0, ret = new Object();
+       var i, count=0, ret = new Array(0);
        for (i=0;i<io.results.length;i++) {
                var sessions = io.results[i].info.sessions.sessions;
                var j;
@@ -33,14 +33,13 @@ function smbsrv_sessions()
                        count++;
                }
        }
-       ret.length = count;
        return ret;
 }
 
 /*
   return a list of current tree connects
 */
-function smbsrv_trees()
+function smbsrv_tcons()
 {
        var irpc = irpc_init();
        status = irpc.connect("smb_server");
@@ -49,7 +48,7 @@ function smbsrv_trees()
        }
 
        var io = irpcObj();
-       io.input.level = irpc.SMBSRV_INFO_TREES;
+       io.input.level = irpc.SMBSRV_INFO_TCONS;
        status = irpc.smbsrv_information(io);
        if (status.is_ok != true) {
                return undefined;
@@ -58,10 +57,10 @@ function smbsrv_trees()
        /* gather the results into a single array */
        var i, count=0, ret = new Object();
        for (i=0;i<io.results.length;i++) {
-               var trees = io.results[i].info.trees.trees;
+               var tcons = io.results[i].info.tcons.tcons;
                var j;
-               for (j=0;j<trees.length;j++) {
-                       ret[count] = trees[j];
+               for (j=0;j<tcons.length;j++) {
+                       ret[count] = tcons[j];
                        count++;
                }
        }