RE: [PHP] get current username from the windows system
| From: | James Lobley | Date: | Thu, 23 Jan 2003 11:05:59 +0000 |
| Subject: | RE: [PHP] get current username from the windows system | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-132787@lists.php.net to get a copy of this message | ||
Hi Thomas,
The following code should help you...
Note that you have to turn off anonymous access in IIS, so that the user
authenticates to a domain.
<?
$ip = getenv("REMOTE_ADDR");
echo("IP address is $ip<BR>");
$user_chunks = explode("\\",strtoupper(getenv("REMOTE_USER")));
$user_domain = $user_chunks[0];
$user_name = $user_chunks[1];
echo("User domain is $user_domain<BR>");
echo("User name is $user_name<BR>");
?>
James
-----Original Message-----
From: Thomas Franz [mailto:thomas.franz@esv-siershahn.de]
Sent: 23 January 2003 10:44
To: php-general@lists.php.net
Subject: [PHP] get current username from the windows system
Hi.
is their a possibilty to get the windows username of the current logged on
user with php.
I want this to make a logon dialog more comfortable.
Thanks for an answer and a little example if it's possible.
Thomas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
This email is only intended for the person(s) to whom it is addressed and
may contain confidential information. Unless stated to the contrary, any
opinions or comments are personal to the writer and do not represent the
official view of the company. If you have received this e-mail in error,
please notify us immediately by reply e-mail and then delete this message
from your system. Please do not copy it or use if for any purposes, or
disclose its contents to any other person.
We make every effort to keep our network free from viruses. You should
independently check this e-mail and any attachments for viruses, as we
can take no responsibility for any computer viruses that might be
transferred by way of this e-mail.