如何使用PHP / IIS读取Windows登录的用户名 [英] How to read Windows logged in username with PHP/IIS

查看:223
本文介绍了如何使用PHP / IIS读取Windows登录的用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个网络。这里我有一个域控制器(DC)我刚刚安装了IIS6,PHP和Mysql。每件事情都很好。:)

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.

我想知道我是否可以使用某个功能或其他东西...它的输出是AD用户名和用户组。

I was wondering 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']

这篇关于如何使用PHP / IIS读取Windows登录的用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆