I'm creating a website in PHP to be used over INTRANET with the server running Windows NT and the clients running Windows XP Pro. All the clients log on to the server at windows startup.
Now, I want to use that login information to automatically log on to website as well. For this I need the ACCOUNT NAME (username) that the client used to login.
So, my question is, How to get windows account username of the client machine in PHP?
Here's some research I've done on this topic. I hope it assists in providing solution.
There's no direct way of getting the clients windows account username over INTERNET as it would be a security issue.
I have to use Internet Information Services (IIS) server on WIndows NT instead of Apache server to get the client's information.
Using this code in PHP we only get the username of the system where the server is running
<?php echo getenv("username"); ?>
If the user is logging on to the web server using a Windows domain (through NT authentication) then in ASP, I can get client's username using:
System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();Also, in ASP in can have the server impersonate the user by setting this in web.config file
<identity impersonate="true" />
</system.web>I'm looking for a similar way in PHP
var objUserInfo = new ActiveXObject(“WScript.network”);