I'm making a sort of phone book and everything is fine:
- Connection and authentification works perfectly
- Research goes aswell
- I can modify user's attributes
Then my boss asked me to add the Location attribute aka "Bureau" in french but openldap won't retrive it and only it.
Here's the code :
$attributes = array();
$attributes[] = 'givenname';
$attributes[] = 'sn';
$attributes[] = 'samaccountname';
$attributes[] = 'mail';
$attributes[] = 'telephonenumber';
$attributes[] = 'useraccountcontrol';
$attributes[] = 'dn';
$attributes[] = 'location';
/*------------------------------------------------------------------------------*/
if ($ldap_bind) // Si la connexon s'est effectuée
{
// Query sur LDAP
$resultat = ldap_search($ldap_connect, $dn, $search_filter, $attributes) or die('Une erreur est survenue pendant la recherche.');
// Transformation de l'objet LDAP en données explotables
$entries = ldap_get_entries($ldap_connect, $resultat);
But when I var_dump($entries), the location attribute isn't in the array, like if the name attribute was wrong. But according to msdn it's the right attribute correctly spelled.
So now I turn myself to you in hope someone can help on this issue.