I recently wanted to integrate Active directory in one of my projects. I created web app with CodeIgniter and used this AD library to integrate AD.
https://github.com/kathmann/Auth_AD
Now it does everything I need, except I cannot get manager's samaccountname or email id.
For example I want to fetch one user 'xyz' all details, I used predefine function from the library which is
get_all_user_data('xyz');
This is getting me all the details and for manager, I am getting below details.
CN=ABC DEF, OU=Users,OU=example1,OU=example2,OU=Sites,DC=example3,DC=example4,DC=example5
Now I want to fetch samaccountname and email of the above. But i am not sure how to do it.
Just let me know what to code further and convert above string to samaccountname and email of the user.
I already saw this thread: ldap filter for distinguishedName
The person question is same as mine but I didn't understand what the answer says. I tried the answer but it gets all the user who has same manager instead the actual manager user.