To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Coding

Coding Help with PHP coding

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-26-2006, 03:39 PM   #1
lubatico
Junior Member
 
Join Date: Nov 2003
Posts: 5
[RESOLVED] Getting computer's system's login?

Greetings, everyone.

Is there any way to write a script that would obtain (automatically, without the need for a login form) the username and password for the local user's machine?

I know this sounds strange, but I am writing an application for our local intranet in which the users have to identify some documents I'll post on the pages and then fill up a form with send it to me. Of course, I need to know who sent what, so I am interested in "capturing" that user's name and attaching it to the form, automatically.

Has anyone done that?


My many, many thanks in advance.

Cheers,

L
lubatico is offline   Reply With Quote
Old 07-26-2006, 05:09 PM   #2
etully
Juņor Curmudgeon
 
Join Date: Apr 2006
Location: Connecticut
Posts: 1,250
Fortunately for people who like their privacy, such a feature does not exist. You'll have to live with the idea of asking them their name and letting them decide whether or not they want to provide it.

You do, however, know their IP address and since it's an Intranet, you know who is at each IP address. Just include this line in the form:

<input type=hidden name=ip_address value="<?php echo $_SERVER['REMOTE_ADDR']; ?>">
etully is offline   Reply With Quote
Old 07-26-2006, 06:16 PM   #3
ColdFusion
Junior Member
 
Join Date: Jul 2006
Posts: 13
The short answer to this is no, and thats the same for the long one too probablly

But as stated above you could have the ip address information stored... just remember to ensure that your network pc's that are involved are using static ip addresses.... otherwise there is no point as the IP addresses may keep changing each time the machine is switched on.
ColdFusion is offline   Reply With Quote
Old 07-26-2006, 06:43 PM   #4
thorpe
addicted
 
thorpe's Avatar
 
Join Date: Aug 2004
Location: sydney
Posts: 3,457
You'll need to research the possibilty through COM. php can provide an interface to COM, however your question would be best asked on an MS board.

eg; How do I retrieve a users login name through COM?
thorpe is offline   Reply With Quote
Old 07-28-2006, 04:26 PM   #5
lubatico
Junior Member
 
Join Date: Nov 2003
Posts: 5
Wink Thanks!

Thanks for the answers!

I cannot use the IP addresses, though, as we have dynamic IP's on our intranet.
Of course, I could write a little script to check with the dns server and retrieve that information, but would rather - at least at this point - avoid such cumbersome solution.

I will investigate the one about COM.

Thanks for your suggestions. If I find anything, I'll post it here. Meanwhile, if anyone has any other suggestions...

Cheers,

L
lubatico is offline   Reply With Quote
Old 07-28-2006, 11:11 PM   #6
bradgrafelman
Pna lbh ernq guvf?
 
Join Date: Jul 2004
Location: 40.566N -89.731W, ~469ft above sea level
Posts: 11,488
What webserver and network are you running? I believe this would be feasible if you're running IIS on an Active Directory-based network.
__________________
***If your problem has been solved, PLEASE click the RESOLVED LINK under "Thread Tools"***

"Well Bones, do the new medical facilities meet with your approval?" -- Kirk
"They do not. It's like working in a damn computer center" -- McCoy (Star Trek: TMP)

Useful links: Debugging 101 || NJOE || (Sig image) || Rolla Engineered Solutions, LLC
bradgrafelman is offline   Reply With Quote
Old 07-29-2006, 01:50 AM   #7
barand
Senile Member
 
Join Date: Oct 2002
Location: Cheshire, UK
Posts: 1,647
This works on a windows intranet using IIS so long as anonymous access is disabled

Code:
$dom_user = $_SERVER['LOGON_USER'];

list ($domain, $username) = explode ('\\', $dom_user);
(You may need to explode with '\\\\' depending on version)
__________________
Barand

baaGrid easy data tables - and more
baaChart easy line, column and pie charts
baaSelect generate js and php code for dynamic linked dropdowns
AJAX/xmlhttp article and sample application
barand is offline   Reply With Quote
Old 07-29-2006, 05:18 AM   #8
MarkR
Senior Member
 
Join Date: Jul 2004
Location: Oxford, England
Posts: 1,983
If you want to do NTLM automatic authentication in IE, the settings have to be exactly right- IE has a lot of security features to stop it authenticating with just any old one automatically - normally it means the site needs to be in either the "intranet zone" or "trusted zone".

Oh yes- and the feature may be turned off entirely by default in some installations, by policy. Also people logged on with local accounts can't use it, nor can users of (most) non-MSIE browsers.

Additionally of course you need access to the user's windows domain controller in order to be able to do this (either directly or via some Active Directory network).

Mark
MarkR is offline   Reply With Quote
Old 08-03-2006, 12:51 PM   #9
lubatico
Junior Member
 
Join Date: Nov 2003
Posts: 5
The solution!!

Thank you all for your kind and valuable answers.
I was a bit afraid of using COM or other "foreign" technologies to integrate it with my php.
The $_SERVER['LOGON_USER'] works fine, except that I needed anonymous user access for the rest of the intranet.

So, I decided to go for the lazy, easy way. I simply created a virtual directory within my intranet and removed the anonymous user from that directory. Now, I can user the $_server... variable with impunity and pass, if need be, to the other script. Or I can write my script on this area.

Many thanks to all of you.

All the best!

Lubatico
lubatico is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 04:09 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.