Accessing Windows Login using php??????

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
deadpool_19
Forum Newbie
Posts: 1
Joined: Wed Apr 07, 2004 12:13 am

Accessing Windows Login using php??????

Post by deadpool_19 »

I have searched and searched in a feeble attempt to find a method to access the username of the windows user currently logged into windows. I have no idea if this can even be done.
Thanx for trying to help

Deadpool
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Do:

Code: Select all

echo '<pre>';
print_r($_SERVER);
echo '</pre>';
if it's anywhere it'll be in $_SERVER.

Mac
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Are you looking to see the remote user, or the server's user?

Remote isn't quite simple unless you are on a LAN with it.

in Win32, GetUserName() and GetUserNameEx() are used to query the calling threads username. LookupAccountName() could also be useful.
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

auth class

Post by djot »

-
Hi,

perhaps this will help also:

http://www.phpclasses.org/browse/package/1556.html
This class is meant to validate the access of an authenticated user to page a page associated with a given Windows Active directory group ...
djot
-
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

jetze
Forum Newbie
Posts: 6
Joined: Wed Apr 14, 2004 3:29 am

Post by jetze »

I recently posted a thread about this subject too. If you are only looking for the username, you can easily get it from the constant variable $HTTP_ENV_VARS["USERNAME"]
Post Reply