PHP LDAP attributes question

From: Date: Thu, 20 Nov 2003 18:27:32 +0000
Subject: PHP LDAP attributes question
Groups: php.general 
Request: Send a blank email to php-general+get-170462@lists.php.net to get a copy of this message
Hello, I am having trouble returning attributes from an LDAP dir and was curious if anyone had experienced similar issues. I am able to retrieve the attributes in the $nds_stuff fine. However, once I add an attribute to the array, I can get the last attribute in the array, but not the one that comes before. For example, this returns usertier2, but not usertier. If I switch the order, I can get the last one, but not the one that comes before? Here is my code: $filter="(|(cn=" . $login_name . "*))"; //Attributes to get from NDS $nds_stuff = array("cn", "sn", "fullname", "usertier"); //doesn't work as expected //returns usertier2, but usertier is empty //$nds_stuff = array("cn", "sn", "fullname", "usertier","usertier2"); //Search for a specified filter on the directory with the scope of LDAP_SCOPE_SUBTREE $results=ldap_search($ldap, $dn, $filter, $nds_stuff); $info = ldap_get_entries($ldap, $results); //This loops Through the array for ($i=0; $i < $info["count"]; $i++) { //Declare the LDAP results as session variables $valid_user = strtolower($info[$i]["cn"][0]); $user_tier = $info[$i]["usertier"][0]; $user_tier2 = $info[$i]["usertier2"][0]; $user_fullname = $info[$i]["fullname"][0]; } //Close LDAP login array loop ldap_close($ldap); Any suggestions? Cory -- Cory Hicks <chicks@tri-intl.com> TRI International

« previous php.general (#170462) next »