Link to home
Start Free TrialLog in
Avatar of bcops
bcops

asked on

Detecting authenticated username in PHP

Hi,
Hope someone can help.

I've got an internal website running on Linux (Ubuntu),Apache 2, MySQL 4.x, PHP4.x that is using mod_ldap.so
mod_auth_ldap.so to do user authentication from an Active Directory LDAP server.

See https://www.experts-exchange.com/questions/21477850/Linux-based-website-detecting-Active-Directory-based-usernames.html for my recent post on this.

My question is this - how can I pick up the authenticated username in a PHP4 script? Must I make some changes to Apache, or PHP? Must I use some PHP module?

Can anyone help?
Many thanks,
Ben.





ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bcops
bcops

ASKER

Hi hernst42,

Many thanks for this. This seemed to work perfectly. One follow up question - do you know how long the session lasts for? Or where one can control that kind of information? Is it an apache setting?

Thanks Ben.

No its a thing of the browser which send the user-id and password until the browser is closed to the same pages and directory below the fist auth-page. So there is no session for the external user-authentication.