From 68453d1da2ad68c1e9cb5d42eb71822ae6f0117b Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Sun, 22 Oct 2006 02:57:28 +0000 Subject: r19449: ldbbrowse: installation hopefully works now. "Developer" installations ('configure.developer' or 'configure --enable-developer') may still have problems as I'm not sure I got all of the paths right for that. With the changes Tridge has made to the Main Menu in swat, given a non-developer installation, you should be able to get to ldbbrowse via: JSON/qooxdoo -> ldb browser Derrell (This used to be commit 2406af10791cd8545c598c8591a48de5515c7dc5) --- swat/apps/samba/utils/ldbbrowse.html | 96 ++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 43 deletions(-) (limited to 'swat') diff --git a/swat/apps/samba/utils/ldbbrowse.html b/swat/apps/samba/utils/ldbbrowse.html index 81b74c44d2..1e6f21ee11 100644 --- a/swat/apps/samba/utils/ldbbrowse.html +++ b/swat/apps/samba/utils/ldbbrowse.html @@ -248,65 +248,75 @@ function buildPageSearch(page) // Track the maximum length of the attribute values var maxLen = 0; - for (var i = 0; i < result.length; i++) + if (result && result["length"]) { - var o = result[i]; - if (typeof(o) != "object") + len = result["length"]; + for (var i = 0; i < result["length"]; i++) { - alert("Found unexpected result, type " + - typeof(o) + - ", " + - o + - "\n"); - continue; - } - for (var field in o) - { - // skip dn and distinguishedName fields; - // they're shown in each row anyway. - if (field == "dn" || field == "distinguishedName") + var o = result[i]; + if (typeof(o) != "object") { + alert("Found unexpected result, type " + + typeof(o) + + ", " + + o + + "\n"); continue; } - - // If it's multi-valued (type is an array)... - if (typeof(o[field]) == "object") + for (var field in o) { - // ... then add each value with same name - var a = o[field]; - for (var i = 0; i < a.length; i++) + // skip dn and distinguishedName fields; + // they're shown in each row anyway. + if (field == "dn" || field == "distinguishedName") { - if (a[i].length > maxLen) + continue; + } + + // If it's multi-valued (type is an array)... + if (typeof(o[field]) == "object") + { + // ... then add each value with same name + var a = o[field]; + for (var i = 0; i < a.length; i++) { - maxLen = a[i].length; + if (a[i].length > maxLen) + { + maxLen = a[i].length; + } + rowData.push( [ + o["dn"], + field, + a[i] + ] ); + } + } + else // single-valued + { + // ... add its name and value to the table + // dataset + if (o[field].length > maxLen) + { + maxLen = o[field].length; } rowData.push( [ o["dn"], field, - a[i] - ] ); - } - } - else // single-valued - { - // ... add its name and value to the table dataset - if (o[field].length > maxLen) - { - maxLen = o[field].length; + o[field] + ] ); } - rowData.push( [ - o["dn"], - field, - o[field] - ] ); } - } - // Adjust the width of the value column based on maxLen - table.setColumnWidth(2, maxLen * 7); + // Adjust the width of the value column based on + // maxLen + table.setColumnWidth(2, maxLen * 7); - // Tell the table to use the new data - tableModel.setData(rowData); + // Tell the table to use the new data + tableModel.setData(rowData); + } + } + else + { + alert("No rows returned."); } } else -- cgit