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
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.
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:
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.
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...
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)
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
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).
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.