The project I have been manage has ran into an issue of updating contents of LDAP. My site uses ldap to make a list of users. New users are not showing any more. I have tracked the issue down to its roots but I am clueless upon whats going wrong. The main parts of the PHP goes like this:
PHP Code:
public function getMember($type){
     
$memeber ="";
     if(
$type == "week1"){
          
$group $this->ldap->getGroupInfo(1006);
          
$member $group["users"];
     }else if (
$type == "all"){
          
$group $this->ldap->getGroupInfo(1008);
          
$member $group["users"];
     } 

 
var_dump($member[116]);       
 
$i 0;

 foreach(
$member as &$registered){
         
$i++;
         
$uid $this->ldap->getUidFromUserName($registered);
         
print_r($uid);
         
$newInfo = array();
         
print_r($registered);     
         if(
$uid != ""){
                  
$userInfos $this->ldap->getUserInfo($uid);
                  
$newInfo["uID"] = $uid;
                  
$newInfo["userName"] = $userInfos["userName"];
                  
$newInfo["groups"] = $userInfos["groups"];
                  
$userName $newInfo["userName"]; 
         } else { 
false;
         }
} }
print_r($member);
$member array_filter($member);
return 
$member
var_dump(&members[116]); out put shows: string 'johnr' (length=5) johnr is the user I have added which is not showing up in the list. This means my php above it is grabbing the user.

The print_r($uid); shows the uid, but of only those who show up on the list. Meaning johnr's uid is not in that. turns out all newly added users come up false for uid with this.

Now if you look towards the bottom there print_r($member); that outputs [111] => [112] => [113] => [114] => [115] => [116] => [117] => [118] => [119] => [120] => [121] => [122] => [123] => [124] => ) which all these numbers are newly added users array number (johnr's is 116) what should print for each of these array numbers is something along the lines of [92] => Array ( [uID] => 2003 [userName] => testr [groups] => Array ( [0] => 1006 ) NOTE: This is what all the rest of the print shows for all the members showing up. above it is just a cut out of whats is print_r for those not showing up in the list.

I did a ldapUserSearch and the johnr accounts ldif information is the same as working ones. I also did a ldapGroupSearch and johnr as well is the same as working users.

Another interesting thought is if you change the php code if statement to if($uid != "" || $uid == ""){ the php shows those users who are not showing up but null-ed. So it has something to do with the $uid. but johnr has a uid of 2099, so not sure exactly why its not finding one.

turns out its not grabbing the uID, Username, or group from ldap for johnr but is for every working name... its able to turn member to the array so johnr show up there but after that johnr has no properties it should have. What in LDAP would cause an issue like this?

the getUidFromUserName function looks like this:
PHP Code:
public function getUidFromUserName($username) {
             if(isset(
$this->userNames[$username]))
                      return 
$this->userNames[$username];
             
$this->lookupUsers();
             if(isset(
$this->userNames[$username]))
                      return 
$this->userNames[$username];
             else
                      return 
false;

I hope this is enough information to get some help. If you have any questions please comment that below and i'll do my best to answer them.