November 18th, 2000, 11:41 PM
I'd like to setup some intranet pages that are personalized by user. However, I'd like to keep my users with one name/password that's dynamically updated in all "places" when they change their userame and password. Thus, I think I want to use IIS4's built in NT Domain auhentication.
Now, I know how to suck the current authenticated user in VBScript ASP code... is there any way to get this same info in PHP? Would a session variable be the way to go, putting the auth routines in ASP and then transfering the info to PHP with session vars? or something else "Secure"? I'm not a pro on session variables...
Any help or code snippents are greatly appreciated! Thanks,
November 19th, 2000, 02:38 AM
Can you use $PHP_AUTH_USER or is that just for Apache?
November 19th, 2000, 02:58 AM
I *think* I tried that, and it only worked if I used PHP's built in authentication and validated it against a database or whatnot... I'm trying to use IIS' functions to validate against the NT user database.
November 19th, 2000, 04:07 PM
Okay -- I got it. Thanks to fellow board member Matt Robinson for his reply:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>More importantly, if you're using IIS, you can tell it to allow access
based on NT logon, and you can read the environment to fetch the logged
in username. Create an empty PHP page (after you've figured out how to
get an authenticated access from IIS - forgive me if I forget where the
setting's kept) and insert <? phpinfo(); ?> and load it through your
webserver. You should get the necessary info in the environment
I hadn't tried doing a phpinfo() within an authenticated realm. Sure enough, it listed all of the additional variables, including current user, that I could ever want. All it takes i a <? echo($AUTH_USER); ?> for the username.
Thanks Matt, et al.