RE: [PHP] Is there any way of knowing User Currently Logged On?

2004-10-12 Thread Warren Vail
If it throws out garbage, you should be able to execute the who command on
the remote system, which should show users that are currently signed on to a
Unix or Linux system and if you do it all in the perl script, you can format
the output to look pretty much the same (in case you haven't figured it out
the @users_list is an array, very similar to PHP arrays actually [IMHO]).
If you modified the perl script to detect the garbage, it could simply do a
telnet connection and execute the who command.  There are probably ways
that use privileged commands similar to the one used for your windows
solution on remote Linux Unix, but I don't know them, and I'm not sure it's
a good idea to use them in a PHP script, but you can get opinions the other
way as well.  If all your machines are behind the same firewall, away from
the internet, the risk could be less if you have a good firewall.  For your
telnet connection from perl look for the net:telnet perl module at
http://www.cpan.org/modules/by-module/Net/ , if you know PHP you will find
perl quite easy I think.

Good luck.

Warren Vail

-Original Message-
From: Mulley, Nikhil [mailto:[EMAIL PROTECTED]
Sent: Monday, October 11, 2004 9:54 PM
To: Vail, Warren; Mulley, Nikhil; [EMAIL PROTECTED]
Subject: RE: [PHP] Is there any way of knowing User Currently Logged On?

Hi Vail,

My Worry is that If a remote OS is not Windows, then this would throw out
garbage,
Where as this Perl Script would work well at a Windows Side ,Bcoz I am using
the 'Win32'  Module ,is there any other module such that .
We cannot even predict ( or I believe there is no exact way ) what the
remote OS could be :(



Nikhil.

-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Monday, October 11, 2004 11:33 PM
To: 'Mulley, Nikhil'; [EMAIL PROTECTED]
Subject: RE: [PHP] Is there any way of knowing User Currently Logged On?


If you code in php something like the following, you just might be able to
use the perl script;

$ok = exec(path/to/Perl myperscriptname.pl server, $result);   // you may
have to straighten out syntax
Foreach($result as $line) {
echo $line;   // or you could process the results
}

Hope this helps,

Warren Vail


-Original Message-
From: Mulley, Nikhil [mailto:[EMAIL PROTECTED]
Sent: Monday, October 11, 2004 9:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Is there any way of knowing User Currently Logged On?


Hi Guys,

Is there any way of finding the current user logged on the remote system

I have a perl script which gets the user name who is currently logged on a
remote Windows Machine





#LoggedOnUsers(server, userRef).pl
use Win32::NetAdmin;
use strict;
use vars qw($server @users_list);
if(@ARGV0){
$server=$ARGV[0];
}
else{
print \n\nEnter a valid Hostname  or IP Address : ;
chomp($server=STDIN); }
Win32::NetAdmin::LoggedOnUsers($server,[EMAIL PROTECTED]);
foreach(@users_list) {
print \n$server-- $_;
}


This one gets the users logged in on a remote Windows machine , Is there a
similar way of finding / doing the same regardless of an OS, Can it be done
through a Web Browser 

Any Clues ??

--Nikhil.

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

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



RE: [PHP] Is there any way of knowing User Currently Logged On?

2004-10-12 Thread Gryffyn, Trevor
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B324274

Here's a link that talks about how to do it in IIS for Windows Server
2003.  It's for when you're logging into a domain though, are you doing
that with all those different platforms? The client accessing the web
server has to be logged into the domain for it to function.  There might
be something similar you can do if you're running a web server on a unix
system and you're logged into another unix system.   And if your web
server is on a unix system, but your client is a Windows box with a
domain authenticated user, you can probably still access the LOGON_USER
variable.

-TG

 -Original Message-
 From: Mulley, Nikhil [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, October 12, 2004 1:02 AM
 To: Gryffyn, Trevor; [EMAIL PROTECTED]
 Cc: John Holmes; Mulley, Nikhil
 Subject: RE: [PHP] Is there any way of knowing User Currently 
 Logged On?
 
 
 How do I turn on the Integrated Authentication turned on.
 
 
 Ours is a mixed heterogenous network which has 
 Windows,Linux,Solaris,BSD Lindows,Linspire and many other OS 
 all together,So How Do I?
 
 -Original Message-
 From: Gryffyn, Trevor [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 12, 2004 1:07 AM
 To: [EMAIL PROTECTED]
 Cc: John Holmes; Mulley, Nikhil
 Subject: RE: [PHP] Is there any way of knowing User Currently 
 Logged On?
 
 
 It does and Windows Integrated Authentication has to be turned on (and
 Anonymous access turned off).
 
 I just got my company to configure that so my PHP scripts 
 could grab the
 authenticated user for logging purposes.
 
 -TG
 
  -Original Message-
  From: John Holmes [mailto:[EMAIL PROTECTED] 
  Sent: Monday, October 11, 2004 2:49 PM
  To: Mulley, Nikhil
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] Is there any way of knowing User Currently 
  Logged On?
  
  
  Mulley, Nikhil wrote:
  
   Is there any way of finding the current user logged on the 
  remote system
  
  You can try $_SERVER['LOGON_USER'], but I think the 
 remote computer 
  has to be in the same domain as the server...
  
  -- 
  
  ---John Holmes...
  
  Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
  
  php|architect: The Magazine for PHP Professionals - www.phparch.com
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 

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



RE: [PHP] Is there any way of knowing User Currently Logged On?

2004-10-11 Thread Vail, Warren
If you code in php something like the following, you just might be able to
use the perl script;

$ok = exec(path/to/Perl myperscriptname.pl server, $result);   // you may
have to straighten out syntax
Foreach($result as $line) {
echo $line;   // or you could process the results
}

Hope this helps,

Warren Vail


-Original Message-
From: Mulley, Nikhil [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 11, 2004 9:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Is there any way of knowing User Currently Logged On?


Hi Guys,
 
Is there any way of finding the current user logged on the remote system
 
I have a perl script which gets the user name who is currently logged on a
remote Windows Machine
 
 
 
 
 
#LoggedOnUsers(server, userRef).pl
use Win32::NetAdmin;
use strict;
use vars qw($server @users_list);
if(@ARGV0){
$server=$ARGV[0];
}
else{
print \n\nEnter a valid Hostname  or IP Address : ;
chomp($server=STDIN); }
Win32::NetAdmin::LoggedOnUsers($server,[EMAIL PROTECTED]);
foreach(@users_list) {
print \n$server-- $_;
}
 
 
This one gets the users logged in on a remote Windows machine , Is there a
similar way of finding / doing the same regardless of an OS, Can it be done
through a Web Browser 
 
Any Clues ??
 
--Nikhil.

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



Re: [PHP] Is there any way of knowing User Currently Logged On?

2004-10-11 Thread John Holmes
Mulley, Nikhil wrote:
Is there any way of finding the current user logged on the remote system
You can try $_SERVER['LOGON_USER'], but I think the remote computer 
has to be in the same domain as the server...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Is there any way of knowing User Currently Logged On?

2004-10-11 Thread Gryffyn, Trevor
It does and Windows Integrated Authentication has to be turned on (and
Anonymous access turned off).

I just got my company to configure that so my PHP scripts could grab the
authenticated user for logging purposes.

-TG

 -Original Message-
 From: John Holmes [mailto:[EMAIL PROTECTED] 
 Sent: Monday, October 11, 2004 2:49 PM
 To: Mulley, Nikhil
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Is there any way of knowing User Currently 
 Logged On?
 
 
 Mulley, Nikhil wrote:
 
  Is there any way of finding the current user logged on the 
 remote system
 
 You can try $_SERVER['LOGON_USER'], but I think the remote computer 
 has to be in the same domain as the server...
 
 -- 
 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals - www.phparch.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



RE: [PHP] Is there any way of knowing User Currently Logged On?

2004-10-11 Thread Mulley, Nikhil
No Holmes ,Its not working , is there any other way ...

And My specific would be something that by Giving an IP or a hostname ,the script 
should fetch the user logged in currently,,

like when we use the nbtstat command on a Windows Domain with the argument as the 
hostname , it would fetch the details something like this.

P:\nikhil\userloggedon nbtstat -an hydws00014

Local Area Connection:
Node IpAddress: [10.103.6.22] Scope Id: []

   NetBIOS Remote Machine Name Table

   Name   Type Status
-
HYDWS00014 00  UNIQUE  Registered
JUNOHYD00  GROUP   Registered
HYDWS00014 03  UNIQUE  Registered
HYDWS00014$03  UNIQUE  Registered
HYDWS00014 20  UNIQUE  Registered
JUNOHYD1E  GROUP   Registered
MSASI  03  UNIQUE  Registered   == He is the actual user 
currenly logged on.
HYDWS00014 01  UNIQUE  Registered

MAC Address = 00-B0-D0-2D-DF-6F


Regards,
Nikhil.



-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 12, 2004 12:19 AM
To: Mulley, Nikhil
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Is there any way of knowing User Currently Logged On?


Mulley, Nikhil wrote:

 Is there any way of finding the current user logged on the remote system

You can try $_SERVER['LOGON_USER'], but I think the remote computer 
has to be in the same domain as the server...

-- 

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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



RE: [PHP] Is there any way of knowing User Currently Logged On?

2004-10-11 Thread Mulley, Nikhil
Hi Vail,

My Worry is that If a remote OS is not Windows, then this would throw out garbage,
Where as this Perl Script would work well at a Windows Side ,Bcoz I am using the 
'Win32'  Module ,is there any other module such that .
We cannot even predict ( or I believe there is no exact way ) what the remote OS could 
be :(



Nikhil.

-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Monday, October 11, 2004 11:33 PM
To: 'Mulley, Nikhil'; [EMAIL PROTECTED]
Subject: RE: [PHP] Is there any way of knowing User Currently Logged On?


If you code in php something like the following, you just might be able to
use the perl script;

$ok = exec(path/to/Perl myperscriptname.pl server, $result);   // you may
have to straighten out syntax
Foreach($result as $line) {
echo $line;   // or you could process the results
}

Hope this helps,

Warren Vail


-Original Message-
From: Mulley, Nikhil [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 11, 2004 9:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Is there any way of knowing User Currently Logged On?


Hi Guys,
 
Is there any way of finding the current user logged on the remote system
 
I have a perl script which gets the user name who is currently logged on a
remote Windows Machine
 
 
 
 
 
#LoggedOnUsers(server, userRef).pl
use Win32::NetAdmin;
use strict;
use vars qw($server @users_list);
if(@ARGV0){
$server=$ARGV[0];
}
else{
print \n\nEnter a valid Hostname  or IP Address : ;
chomp($server=STDIN); }
Win32::NetAdmin::LoggedOnUsers($server,[EMAIL PROTECTED]);
foreach(@users_list) {
print \n$server-- $_;
}
 
 
This one gets the users logged in on a remote Windows machine , Is there a
similar way of finding / doing the same regardless of an OS, Can it be done
through a Web Browser 
 
Any Clues ??
 
--Nikhil.

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



RE: [PHP] Is there any way of knowing User Currently Logged On?

2004-10-11 Thread Mulley, Nikhil
How do I turn on the Integrated Authentication turned on.


Ours is a mixed heterogenous network which has Windows,Linux,Solaris,BSD 
Lindows,Linspire and many other OS all together,So How Do I?

-Original Message-
From: Gryffyn, Trevor [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 12, 2004 1:07 AM
To: [EMAIL PROTECTED]
Cc: John Holmes; Mulley, Nikhil
Subject: RE: [PHP] Is there any way of knowing User Currently Logged On?


It does and Windows Integrated Authentication has to be turned on (and
Anonymous access turned off).

I just got my company to configure that so my PHP scripts could grab the
authenticated user for logging purposes.

-TG

 -Original Message-
 From: John Holmes [mailto:[EMAIL PROTECTED] 
 Sent: Monday, October 11, 2004 2:49 PM
 To: Mulley, Nikhil
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Is there any way of knowing User Currently 
 Logged On?
 
 
 Mulley, Nikhil wrote:
 
  Is there any way of finding the current user logged on the 
 remote system
 
 You can try $_SERVER['LOGON_USER'], but I think the remote computer 
 has to be in the same domain as the server...
 
 -- 
 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals - www.phparch.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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