PHP LDAP返回部分数据

I am accessing an Active Directory server via PHP's ldap_* functions. Part of the task is to determine application permissions based on AD group membership. For my user this works correctly, for some other users, the "memberOf" field is not part of the returned data. What would cause this attribute to be missing? What can I do to determine group membership in its absence?

$ds = ldap_connect($ldap['host']);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
if ($ds) {
    $r  = ldap_bind($ds, $ldap['user'], $ldap['pass']);
    $sr = ldap_search($ds, $ldap['path'], "samaccountname=".$username, array(), 0, 1000, 5);
    $info = ldap_get_entries($ds, $sr);
}

Turns out I was able to work around this problem by pulling all the members of the group and searching the results for the current user. I still don't know why the data was missing from the user pull.

$ds = ldap_connect($ldap['host']);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
if ($ds) {
    $r  = ldap_bind($ds, $ldap['user'], $ldap['pass']);
    $sr = ldap_search($ds, $group, "cn=*", array(), 0, 1000, 5);
    $info = ldap_get_entries($ds, $sr);
}
foreach ($info[0]['member'] as $member) {
    if ($member == $currentUserDistinguishedName) {
        // Do Authorized stuff
        break;
    }
}