testing how extension attribs work under ad/ldap
authorpaulr <me@pjr.cc>
Tue, 23 Nov 2010 03:13:35 +0000 (14:13 +1100)
committerpaulr <me@pjr.cc>
Tue, 23 Nov 2010 03:13:35 +0000 (14:13 +1100)
unittests/ldapbindtest.php [new file with mode: 0644]

diff --git a/unittests/ldapbindtest.php b/unittests/ldapbindtest.php
new file mode 100644 (file)
index 0000000..24cf62d
--- /dev/null
@@ -0,0 +1,27 @@
+<?php 
+
+// just trying to test how extensionAttributes work in AD. they seem to be exactly what we're looking for in terms of a place to plonk our data
+$ds = ldap_connect("------", 389);
+if($ds) {
+       $r = ldap_bind($ds, "-----", "-----");
+       if($r) {
+               echo "r is r\n";
+       } else {
+               echo "r is not r\n";
+       }
+       
+       //$sr = ldap_search($ds, "CN=administrator, CN=Users, ----", "objectclass=*");
+       
+       //if($sr) {
+//             echo "sr is sr\n";
+       //}
+       
+       //$info = ldap_get_entries($ds, $sr);
+       $info["extensionattribute2"] = "-----";
+       
+       ldap_modify($ds, "CN=administrator, CN=Users, dc=safeneter, dc=int", $info);
+       
+       //print_r($info);
+}
+
+?>
\ No newline at end of file