如何阅读的Windows loged的用户名与PHP / IIS用户名、loged、Windows、PHP

2023-09-08 12:02:37 作者:浮生丶若只是夢

我正在运行的网络。在这里,我有我刚安装IIS6,PHP和MySQL上有一个域控制器(DC)。每一件事情是工作的罚款。)

I am running a network. Here I have a domain controller (DC) I just installed IIS6 , PHP and Mysql on it. every thing is working fine.:)

现在我想提出一个脚本,在这个地方网站。 第一个问题是,我希望能够检测到网络用户(活动目录用户)中的一个登录用PHP。我的意思是这是足以让我当用户登录到Windows就没有必要再认证。

Now I want to bring up a script on this local website. The first problem is that I want to detect which one of network users (active directory users) are logged in with PHP. I mean it is enough for me when the user is logged in to windows there is no need for another authentication.

我woundering,如果我可以只使用一个函数或东西...它的输出是AD用户名和用户组。

I was woundering if I could just use a function or something... that its output is the AD username and user group.

推荐答案

如果您已设置IIS来验证用户身份的一种或多种,​​这些应包含的用户名:

If you've set IIS to authenticate users one or more of these should contain the username:

$_SERVER['LOGON_USER']
$_SERVER['AUTH_USER']
$_SERVER['REDIRECT_LOGON_USER']
$_SERVER['REDIRECT_AUTH_USER']