473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 10205
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Babu Mannaravalappil | last post by:
My Windows application (C#) has a login screen and a user table to handle user rights and accessibility. This is independant of the OS level user security. At the time of launching the...
0
by: Wayne Gibson | last post by:
Hi all, Please ignore the other post.. The cat jumped on the machine and sent it before I could stop it!! Was wondering if anybody has expericence this problem.. I am writting an application...
2
by: uli2003wien | last post by:
Dear group, I am a DB-Administrator for a Company that creates and maintains a software solution based on SQL-Server and Crystal-Reports. The Crystal-Reports part uses the following method to...
15
by: bb nicole | last post by:
The company profile showed blank after user login and click the company profile button. Supposed the company profile should not be blank and will show the company information which call from...
22
by: klenwell | last post by:
I'm in the process of refactoring the php code base I've amassed over the last few years into an object-oriented framework. I'm about to start in on the authentication/login extension and I've...
1
by: Ricardo Luceac | last post by:
Hi all... I'm been working with asp.net and I use the membership and roles providers that are built in controls.. Now I need do do an windows application, I've not found these controls in...
1
by: Brave | last post by:
I create email forms in ASP for my company, and have a question about capturing the users login information to keep them from having to enter their name on every form. I am hoping to pre-populate...
4
cobra35y
by: cobra35y | last post by:
Good Afternoon, I am new to the world of programming. after reviewing this site for info pertaining to my situation, i have declared a loss and posting for help. maybe i am just overlooking the...
4
by: sightless | last post by:
Hi all, Is it possible to capture Windows user login in Unix? We have a AIX Unix system that allows users to login (using a common login) and run scripts. At the end of the day, we cannot find out...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.