summaryrefslogtreecommitdiff
path: root/swat
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-10-22 02:57:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:33 -0500
commit68453d1da2ad68c1e9cb5d42eb71822ae6f0117b (patch)
tree59475927a3a005b806baa5f1d92451e9f3c61c8d /swat
parent7653fa22d961755b1c943e1542cc96466a5cbe75 (diff)
downloadsamba-68453d1da2ad68c1e9cb5d42eb71822ae6f0117b.tar.gz
samba-68453d1da2ad68c1e9cb5d42eb71822ae6f0117b.tar.bz2
samba-68453d1da2ad68c1e9cb5d42eb71822ae6f0117b.zip
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)
Diffstat (limited to 'swat')
-rw-r--r--swat/apps/samba/utils/ldbbrowse.html96
1 files changed, 53 insertions, 43 deletions
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