RE: NT username detectable?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Probably not the most reliable way (actually, I know it's not 100%
reliable), but the way I use for quick and dirty, informal usage logging
is this:

$ipaddress = $_SERVER["REMOTE_ADDR"];

$nbtstat = "nbtstat -A ". $ipaddress;
exec ($nbtstat,$result);
foreach ($result as $row) {
  if (strpos($row,"<03>")) $username = strtok($row," ");
}


This only works if you're on the same network and the users are logging
into their box.

It seems to fail when someone is logged into multiple machines at once,
you end up getting the computer name or something.  Probably does this
under other circumstances as well.  But there's some little 80% reliable
way of doing it.

If you find a better way, by all means let me know!

-TG

> -----Original Message-----
> From: GHaider@xxxxxxxxxx [mailto:GHaider@xxxxxxxxxx] 
> Sent: Thursday, September 02, 2004 3:49 PM
> To: php-windows@xxxxxxxxxxxxx
> Subject:  NT username detectable?
> 
> 
> In the html headers, the server sees the clients OS, user agent, IP 
> address etc. Is there a way on a local LAN a server might be 
> able to know 
> the username of the client that sends a request?
> 
> I've checked all $_SERVER variables, PHP_AUTH_USER  etc 
> require the auth 
> box to be displayed. I'm thinking it might be possible to 
> know which user 
> is logged in when the request is made, possibly by using COM or even 
> (gasp) .NET, without having to ask the user his username.
> 
> Any ideas if this can be accomplished at all?
> 
> Right now we have Firefox clients and Apache with PHP in an Active 
> Directory domain with NT4 compatibility, but we can move to IE6 with 
> IIS+PHP if that will work.
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux