How to get LDAP attributes with PHP
Posted: Sat Nov 28, 2009 8:06 am
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
im unable to get the LDAP attibutes. But i can able to connect the LDAP server My code is
The above code list the Departments in my ldap server....i want to list the attributes in my LDAP server...can any one HELP me please ????
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
im unable to get the LDAP attibutes. But i can able to connect the LDAP server My code is
Code: Select all
<?
require("ldapclass.php");
ini_set('memory_limit','64M');
$ldap = new ldap("dc 192.168.05","389","dc=sholen,dc=edu");
$ldap->ldapConn();
//binding with the database using username and password
$bind=$ldap->ldapBind("XXXX@sholen.edu","YYYYY");
//fixing directory name
$ouArray = array("staff");
//searching the department name for all the users in staff
$results = $ldap->ldapSearch("department","*",$ouArray,"department");
$i=0;
$results= array_unique($results);
//rearranging array
foreach($results as $output)
{
$name[$i]=$output;
echo " $name[$i] <br>";
$i++;
}
//ldap authentication
$auth = $ldap->ldapAuthenticate("search@sholen.edu","sholen123");
?>The above code list the Departments in my ldap server....i want to list the attributes in my LDAP server...can any one HELP me please ????
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: