简体   繁体   中英

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 $eadUserName;

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM