469,358 Members | 1,583 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,358 developers. It's quick & easy.

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.

Jul 21 '06 #1
5 9943
sachu wrote:
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

Jul 21 '06 #2

Thanks a lot :)
It Worked for me........

Jul 21 '06 #3
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..

Jul 21 '06 #4
sachu wrote:
Hi Csaba,
The solution given by you works only on the server side....[In the
Of course.
Good that you give an example.
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..
By what right should s1 have access to any knowledge of s2, or users
thereof? s1 gets only the information that s2 chooses to send, and
that is fairly minimal because of privacy concerns (ie. the IP address
and sometimes info about the operating system/browser). And you can
see this info using phpinfo() or in your server logs. The access to s2
of php that is running on s1 is zilch, unless you are leaving out a big
aspect of your situation.

In general, if you want to match up a client's request with a previous
request, set a cookie in the client's browser or use sessions.

Csaba

Jul 21 '06 #5
Csaba , I got a solution.
Solution :
I have enabled DIGITAL AUTHENTICATION FOR WINDOWS DOMIAN Server and set
the Realm to the domain server in IIS.
Note:
You have to disable Anonymous access.

Now, Its possible to access the user name through
$_SERVER['LOGON_USER']

Jul 22 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Babu Mannaravalappil | last post: by
reply views Thread by Wayne Gibson | last post: by
22 posts views Thread by klenwell | last post: by
1 post views Thread by Ricardo Luceac | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.