Link to home
Start Free TrialLog in
Avatar of aniston
aniston

asked on

What is the client's Windows USER NAME ?

We have several computers on our Windows 2003 domain network.  All client PCs are using Windows XP Pro and must login to WIndows to get to the desktop nd their unique profile.  From there they normally access the intranet webpage which then asks the agent again to login.  

Is there any way with my PHP script to identify what is the user's name that is accessing the script?  I am able to extract the IP/Host of the computer hitting the script but how does one translate this into a paritcular user name that has logged in to that PC?  Is there some environment variable or must i use Active Directory?  I intend on installing an ActiveX control (VB6 or C# not sure) for every IE browser and so I suppose i will have more access to the system details and could get this info transfered to the PHP script for a silent login.  But what do i look up?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aniston
aniston

ASKER

Hern,. thanks for the dead on response.  Curious, I have a PHP script that in code makes a second http request for a script in another location on the server.  When the system was set to Anonymous I could get the response from this url but now i get 401 access denied.  All folders on the system have the integrated windows authentication set and thats not a problem when i hit the standard pages but why does the same PHP script have a problem with making its own HTTP request to another file on the server.  What user name is it using?  I would have guessed it access the folder on my behalf but I suppose its acting anonymously?  Do i just insert some special header for the script to get around this?

Thanks.
The problem is that if you open a http-connection from php it does not include the NTLM-auth-token and thus the webserver thinks its an anonymous access. With default php you will not be able to use WinAuth for those request.

It might be possible to use the curl-extension, but I don't know how to include a NTML-auth-token there.

Why do you need that call to the other script?
Avatar of aniston

ASKER

This unusual approach to calling another script is just some patch to get .asp and .php to communicate.  It'[s just a patchwork which the newer website wont have to deal with.  I just wanted to know the solution in case something similar pops up.  Thanks!