Note that there are some explanatory texts on larger screens.

plurals
  1. POLDAP/PHP Issue updating Newly Added User
    text
    copied!<p>The project I have been managing 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, but old uses are. 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: </p> <pre><code>public function getMember($type){ $memeber =""; if($type == "week1"){ $group = $this-&gt;ldap-&gt;getGroupInfo(1006); $member = $group["users"]; }else if ($type == "all"){ $group = $this-&gt;ldap-&gt;getGroupInfo(1008); $member = $group["users"]; } var_dump($member[116]); $i = 0; foreach($member as &amp;$registered){ $i++; $uid = $this-&gt;ldap-&gt;getUidFromUserName($registered); print_r($uid); $newInfo = array(); print_r($registered); if($uid != ""){ $userInfos = $this-&gt;ldap-&gt;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; </code></pre> <p><code>var_dump(&amp;members[116]);</code> out put shows: <code>string 'johnr' (length=5)</code> 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. Usually number that do show up contain the uid, and all those $newinfo[...] = ... information. This doesn't.</p> <p><code>johnr</code>s group id is 1006 just for the information.</p> <p>The <code>print_r($uid);</code> shows the uid, but of only those who show up on the list. Meaning johnr's uid is not in that.</p> <p>Now if you look towards the bottom there <code>print_r($member);</code> that outputs <code>[111] =&gt; [112] =&gt; [113] =&gt; [114] =&gt; [115] =&gt; [116] =&gt; [117] =&gt; [118] =&gt; [119] =&gt; [120] =&gt; [121] =&gt; [122] =&gt; [123] =&gt; [124] =&gt; )</code> 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 <code>[92] =&gt; Array ( [uID] =&gt; 2003 [userName] =&gt; testr [groups] =&gt; Array ( [0] =&gt; 1006 )</code> 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.</p> <p>I did a ldapUserSearch and the <code>johnr</code> accounts ldif information is the same as working ones. I also did a ldapGroupSearch and <code>johnr</code> as well is the same as working users. </p> <p>Another interesting thought is if you change the php code if statement to <code>if($uid != "" || $uid == ""){</code> the php shows those users who are not showing up but null-ed. So it has something to do with the <code>$uid</code>. but johnr has a uid of 2099, so not sure exactly why its not finding one. </p> <p>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.</p> <p>------Edit------/</p> <p>turns out its not grabbing the uID, Username, or group from ldap for <code>johnr</code> but is for every working name... its able to turn member to the array so <code>johnr</code> show up there but after that <code>johnr</code> has no properties it should have.</p> <p>All properties in the ldapUserSearch are the same for working and non-working users. Also these non-working users are in the same groups as those working.</p> <p>the <code>getUidFromUserName</code> function looks like this:</p> <pre><code>public function getUidFromUserName($username) { if(isset($this-&gt;userNames[$username])) return $this-&gt;userNames[$username]; $this-&gt;lookupUsers(); if(isset($this-&gt;userNames[$username])) return $this-&gt;userNames[$username]; else return false; } </code></pre> <p>More information. All the working and non working accounts do show up in passwd and group with working standards.</p> <p>I am on a Linux server if thats information needed.</p> <p>What in LDAP would cause an issue like this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload