summaryrefslogtreecommitdiff
path: root/swat/esptest/ldb.esp
blob: cf2725fbcf76cc45f5d0ec96503fe11964d0a3b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<% page_header("columns", "ESP ldb test", "esptest"); %>

<h1>Samba4 ldb test</h1>

<h3>An attribute constrained search</h3>

<%
var lp = loadparm_init();
var dbfile = lp.get("sam database");
var attrs = new Array("name", "dnsDomain", "objectSid", "dn");
var ldb = ldb_init();
ldb.session_info = session.authinfo.session_info;

var ok = ldb.connect(dbfile);
assert(ok);

res = ldb.search("(objectClass=domain)", NULL, ldb.SCOPE_DEFAULT, attrs);
multi_table(res, "dn");
%>

<h3>An unconstrained search</h3>

<%
res = ldb.search("(objectClass=user)");
multi_table(res, "dn");
%>

<h3>A search with bad arguments</h3>

<%
res = ldb.search("=blah", "foo");
%>

all done

<% page_footer() %>