How to display logged in users Active Directory full name using PHP?
I am trying to display the full name of a user in Active Directory on an Intranet page. I can display their user id with:
$eadUserName = $_SERVER['LOGON_USER']; echo $eadUserN开发者_运维技巧ame;
but need to figure out a way to display their full name instead. I am new to PHP so any info would be greatly appreciated. Thank you!
Use PHP LDAP extension in combination with getenv("username")
function.
The php.net manual has a list of all posible variations of the extension: http://php.net/manual/en/ref.ldap.php
精彩评论