| Author |
Message |
sachin *nix forums beginner
Joined: 13 Mar 2006
Posts: 11
|
Posted: Fri Jul 21, 2006 5:44 am Post subject:
Capturing user login Information of windows
|
|
|
Hi Everyone,
I want develop the intranet site with seamless authentication. Is there
any way to capture only the user name who has logged in the windows
machine.
Iam using PHP 5.0 MySQL and IIS Server.
I have tried with $_SERVER['LOGON_USER'] but its returning nothing.
Please help me out. |
|
| Back to top |
|
 |
Csaba Gabor *nix forums beginner
Joined: 27 Mar 2006
Posts: 28
|
Posted: Fri Jul 21, 2006 11:43 am Post subject:
Re: Capturing user login Information of windows
|
|
|
sachu wrote:
| Quote: | Hi Everyone,
I want develop the intranet site with seamless authentication. Is there
any way to capture only the user name who has logged in the windows
machine.
Iam using PHP 5.0 MySQL and IIS Server.
I have tried with $_SERVER['LOGON_USER'] but its returning nothing.
Please help me out.
|
This works for me under WinXP / Apache 2 (note that $nw->username is
not useful in this sense):
$nw = new COM("WScript.Network");
print "username0: " . $nw->username . "<br><br>";
$computername = $nw->computername;
print "computername: $computername<br>";
$owmi = new COM("winmgmts:\\\\$computername\\root\\cimv2");
$comp = $owmi->get("win32_computersystem.name='$computername'");
print "username: " . $comp->username;
Csaba Gabor from Vienna |
|
| Back to top |
|
 |
sachin *nix forums beginner
Joined: 13 Mar 2006
Posts: 11
|
Posted: Fri Jul 21, 2006 11:54 am Post subject:
Re: Capturing user login Information of windows
|
|
|
Thanks a lot
It Worked for me........ |
|
| Back to top |
|
 |
sachin *nix forums beginner
Joined: 13 Mar 2006
Posts: 11
|
Posted: Fri Jul 21, 2006 12:16 pm Post subject:
Re: Capturing user login Information of windows
|
|
|
Hi Csaba,
The solution given by you works only on the server side....[In the
sense, the system which runs apache server]. To be clear lets say s1 is
server comp and u1 as the user of this server. s2 as the client comp
and u2 as the user of this comp.
When i ran the code on the comp u2 it returned me the system name as s1
and the user name as u1.I want it to return the user name of the system
where this php page is opened.
Please help me.. |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|