It was the loop at the bottom that was wrong. print_r() showed everything
This is what I have so far (I snipped it somewhere and just changed the info)
$ldapServer = 'localhost';
$ldapBase = 'cn=group1,ou=groups,ou=internal,O=CORP';
* try to connect to the server
$ldapConn = ldap_connect($ldapServer);
die('Cannot Connect to LDAP server');
$ldapBind = ldap_bind($ldapConn,"cn=root",'password');
die('Cannot Bind to LDAP server');
* set the ldap options
ldap_set_option($ldapConn, LDAP_OPT_PROTOCOL_VERSION, 3);
* search the LDAP server
$ldapSearch = ldap_search($ldapConn, $ldapBase, "(member=*)",array('member'));
$ldapResults = ldap_get_entries($ldapConn, $ldapSearch);
for ($item = 0; $item < $ldapResults['count']; $item++)
for ($attribute = 0; $attribute < $ldapResults[$item]['count']; $attribute++)
$data = $ldapResults[$item][$attribute];
echo $data.": ".$ldapResults[$item][$data]."<br>";
echo '<hr />';
It only returns the first member of the group, not all of them.
each person in the group looks like this in the Admin Client
I'm guessing it doesn't know to put the rest in an array since the name (member) is all the same?
This topic is now closed. New replies are no longer allowed.