I need to be able to check the username and password that the user has logged into Windows 2000 with. The idea is to have a single sign in process whereby when the user logs in to windows and when they start the application that the application authenticates the user based on the windows username and password! I know this is possible using ASP but i can´t find anything about it using Php. Has anyone done this before or know of any tools which do this.
Any help would be greatly appreciated!
Use the environment global....
<? print_r($_ENV); ?>
then pick and choose what you need
The only useful information that gives me is the users IP address which isn´t enough to authenticate a user. I need to get the users login name at least.
Did you even look at the results output by it?
[USERNAME] => BASTIEN [USERPROFILE] => C:\Documents and Settings\BASTIEN
Looks like the user name to me...
If this doesn't meet your needs, consider [man]LDAP[/man]
yes i did look at it - that´s only if php is running on the client machine and not a server somewhere - it doesn´t give you the username
what about http://www.php.net/manual/en/ref.w32api.php
thanks, but i tried using that already but that won´t work cos it just returns the server name to me and not the client name using the windows function getUserName(). It´s executed on the server and so returns the server name. Also tried the $_ENV variables and that works only if the user is in the same domain which isn´t the case. I believe it is now impossible if the user is not in the same domain! using Php only anyway! Also the same with LDAP and radius authentication! Also tried running a script which sent a package using the HTTP_X_Forwarded_FOR - i.e to the client and requested the userdata from that. This worked but once again only if the user is in the same domain - otherwise any firewall will block it. Am going to have to come up with another solution. Thanks for the input though - it´s much appreciated!