問題描述
我正在運(yùn)行網(wǎng)絡(luò).這里我有一個(gè)域控制器 (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.:)
現(xiàn)在我想在這個(gè)本地網(wǎng)站上調(diào)出一個(gè)腳本.第一個(gè)問題是我想檢測哪個(gè)網(wǎng)絡(luò)用戶(活動(dòng)目錄用戶)是用PHP登錄的.我的意思是,當(dāng)用戶登錄到 Windows 時(shí),不需要其他身份驗(yàn)證就足夠了.
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.
我想知道我是否可以只使用一個(gè)函數(shù)或其他東西...它的輸出是 AD 用戶名和用戶組.
I was wondering if I could just use a function or something... that its output is the AD username and user group.
推薦答案
如果您已將 IIS 設(shè)置為對用戶進(jìn)行身份驗(yàn)證,其中一個(gè)或多個(gè)應(yīng)包含用戶名:
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']
這篇關(guān)于如何使用 PHP/IIS 讀取 Windows 登錄用戶名的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!