summaryrefslogtreecommitdiffstats
path: root/swat/esptest/ldb.esp
diff options
context:
space:
mode:
Diffstat (limited to 'swat/esptest/ldb.esp')
-rw-r--r--swat/esptest/ldb.esp63
1 files changed, 63 insertions, 0 deletions
diff --git a/swat/esptest/ldb.esp b/swat/esptest/ldb.esp
new file mode 100644
index 00000000000..3285574bf29
--- /dev/null
+++ b/swat/esptest/ldb.esp
@@ -0,0 +1,63 @@
+<HTML>
+<TITLE>
+Samba4 ESP test
+</TITLE>
+<BODY>
+<h1>Samba4 ldb test</h1>
+
+<form name="LdbTest" method="POST" action="@@request['SCRIPT_NAME']">
+ <input name="submit" type="submit" value="Cancel"><br>
+</form>
+
+<%
+if (request['REQUEST_METHOD'] == "POST") {
+ /* if they cancelled then take them back to the list of tests */
+ if (form['submit'] == "Cancel") {
+ redirect("index.esp");
+ }
+}
+
+/*
+ hmm, this gets fairly involved ...
+*/
+function showLdbRes(res) {
+ for (i in res) {
+ var r = res[i];
+ for (j in r) {
+ var a = r[j];
+ if (typeof(a) == "object") {
+ for (k in a) {
+ write(j + "[" + k + "]=" + a[k] + "<br>\n");
+ }
+ } else {
+ write(j + "=" + r[j] + "<br>\n");
+ }
+ }
+ write("<p>");
+ }
+}
+
+%>
+
+Trying a attribute constrained search on samdb:<p>
+
+<%
+var dbfile = lpGet("sam database");
+var attrs = new Array("name", "dnsDomain", "objectSid");
+
+res = ldbSearch(dbfile, "(objectClass=domain)", attrs);
+showLdbRes(res);
+%>
+
+and now an unconstrained search:<p>
+
+<%
+var dbfile = lpGet("sam database");
+
+res = ldbSearch(dbfile, "(objectClass=domain)");
+showLdbRes(res);
+%>
+
+
+</BODY>
+</HTML>