LDAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesLDAP Programming
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Learn More!


Download to Enter
| Contest Rules

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 14th, 2011, 10:32 AM
jdriselvato jdriselvato is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2011
Posts: 1 jdriselvato User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 45 m 40 sec
Reputation Power: 0
PHP/LDAP New User Data isn't grabbing.

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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesLDAP Programming > PHP/LDAP New User Data isn't grabbing.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap