[英]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. 我试图在Intranet页面上的Active Directory中显示用户的全名。 I can display their user id with:
我可以通过以下方式显示其用户ID:
$eadUserName = $_SERVER['LOGON_USER']; $ eadUserName = $ _SERVER ['LOGON_USER']; echo $eadUserName;
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.
我是PHP新手,所以任何信息将不胜感激。 Thank you!
谢谢!
Use PHP LDAP extension in combination with getenv("username")
function. 将PHP LDAP扩展名与
getenv("username")
函数结合使用。
The php.net manual has a list of all posible variations of the extension: http://php.net/manual/en/ref.ldap.php php.net手册列出了扩展的所有可能的变体: http : //php.net/manual/zh/ref.ldap.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.