Reply to Re: Capturing user login Information of windows

Your name:

Reply:


Posted by Csaba Gabor on 08/18/23 11:53

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация