I just did something like this for work. We are running PHP5 on a Win2k Server with IIS. Changed IIS to not allow "Anonymous" access and checked "Integrated Windows authentication". I put this in the index.php on the root of the site.
<? session_start(); extract($_POST); extract($_GET); extract($_SERVER); extract($_ENV); extract($_SESSION);
// Gets the "domain\username"
$fullRemUser = strtolower($_SERVER["REMOT
// Trims off the "domain\" part of fullRemUser
$trimRemUser = trim($fullRemUser,"domain\
// Should catch anyone not logged into their PC, like Win95, but not sure if this is needed, but I've had no problem so far.
IF ($trimRemUser == "") { header("Location: guest.php"); exit; }
< I define a pile of session variables based on what I pull from Active Directory with their username >
header("Location: home.php"); exit;
?>
If your not on Windows or IIS let us know. Thanks.
Main Topics
Browse All Topics





by: matt_mcswainPosted on 2005-02-02 at 18:58:48ID: 13210395
Here is an ldap class that supposedly works well. com/adldap /
-->http://www.wiggumworld.
And another good link w/ examples.
-->http://us2.php.net/ldap