473,372 Members | 1,596 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,372 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 10203
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.