#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    San Jose, CA USA
    Posts
    2
    Rep Power
    0
    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,
    -JDN
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,647
    Rep Power
    4493
    Can you use $PHP_AUTH_USER or is that just for Apache?

    ---John Holmes...
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    San Jose, CA USA
    Posts
    2
    Rep Power
    0
    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.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    San Jose, CA USA
    Posts
    2
    Rep Power
    0
    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
    section...[/quote]

    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.

IMN logo majestic logo threadwatch logo seochat tools logo