From a492905529352ba1c6f7bf675f53e8498745c9bf Mon Sep 17 00:00:00 2001 From: paulr Date: Tue, 23 Nov 2010 15:34:02 +1100 Subject: [PATCH] Active directory examples. --- example/activedirectory/index.php | 19 +++++++++++++++++ unittests/ldapbindtest.php | 40 ++++++++++++++++++++++++++++-------- 2 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 example/activedirectory/index.php diff --git a/example/activedirectory/index.php b/example/activedirectory/index.php new file mode 100644 index 0000000..e0d5ea2 --- /dev/null +++ b/example/activedirectory/index.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/unittests/ldapbindtest.php b/unittests/ldapbindtest.php index 24cf62d..d58e311 100644 --- a/unittests/ldapbindtest.php +++ b/unittests/ldapbindtest.php @@ -1,27 +1,49 @@ $val) { + //echo "$key is ".$val["distinguishedname"][0]."\n"; + if($val["distinguishedname"][0] != "") { + $user[$i]["dn"] = $val["distinguishedname"][0]; + $user[$i]["acn"] = $val["samaccountname"][0]; + } + + $i ++; + //return 0; + } + + foreach($user as $value) { + $cn = $value["dn"]; + $sr2 = ldap_search($ds, "$cn", "objectclass=*"); + $info = ldap_get_entries($ds, $sr2); + print_r($info); + return 0; + } + + print_r($user); + } ?> \ No newline at end of file -- 1.7.0.4