user.identity.name

No one has ever accused me of being a PHP guru, but I don't think it's possible.

PHP is server-side and completely outside the whole Windows logon process, so it doesn't have direct access to it, as far as I know. The value would have to be acquired using some other scripting language, and then passed to PHP. VB probably could do it, but only on IE. I don't think JS would have access to that information (but again, I could be wrong).

-Rich
 
Nick, you also need to set your web server to not allow anonymous access. Set it to require Windows Authentication, so the session will pass your Windows credentials to the web app. If you don't do that, you won't see the user's Windows credentials / user id.

What web server are you using? IIS 6? Apache?
 
A quick google on your request seems to return a common theme:

You can't unless you use ActiveX. Security.
 
Hmmm....there's got to be a way, with anonymous access allowed. Afterall, asp.net can pull it, so the browser is passing it somehow....

We have a prewritten program that does it in php, I'll have to rip apart the code and figure it out.

asp.net will only do it if you tell it (via the web.config file) to impersonate the current logged in user.

See this article:

http://www.eggheadcafe.com/articles/20050703.asp
 
$_SERVER["REMTE_USER"]

However, you do have to set your web server to NOT allow anonymous access for the directory in which the page is hosted. If you allow anonymous access, then the client and the web request will not be authenticated, and then there will be no "username" to retrieve.

It's easy to set this up in IIS, which leads back to the unanswered question from before--which web server are you using? IIS? Apache? Something else?

In PHP, spit out the phpinfo() output. Let's see what you get. <?php phpinfo() ?>
 
Last edited:
My bad, it is IIS, but I cannot disable anonymous access, unfortunately, as some of the stuff that is being used MUST allow anonymous access (don't ask me why. Maybe when we have a real sysadmin, I can ask that person).

If "some of the stuff" needs anonymous access, what part needs the user's id? You can selectively enable parts of the site to require authentication.
 
Back
Top