3 // 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
4 $host = ""; // for eg "1.2.3.4"
5 $binduser = ""; // for eg "administrator"
6 $bindpass = ""; // for eg "password"
7 $basecn = ""; // for eg "CN=users, DC=google, dc=com"
9 // this is here so i can keep my atributes somewhere in the tree and not have them float around on git/svn
10 if(file_exists("../../../.dontappearingitandsvn.php")) require_once("../../../.dontappearingitandsvn.php");
12 $ds = ldap_connect("$host", 389);
15 $r = ldap_bind($ds, "$binduser", "$bindpass");
22 $sr = ldap_search($ds, "$basecn", "objectclass=user");
28 $info = ldap_get_entries($ds, $sr);
29 //$info["extensionattribute2"] = "-----";
34 foreach($info as $key => $val) {
35 //echo "$key is ".$val["distinguishedname"][0]."\n";
36 if($val["distinguishedname"][0] != "") {
37 $user[$i]["dn"] = $val["distinguishedname"][0];
38 $user[$i]["acn"] = $val["samaccountname"][0];
45 foreach($user as $value) {
47 $sr2 = ldap_search($ds, "$cn", "objectclass=*");
48 $info = ldap_get_entries($ds, $sr2);