title: Authenticate against ldap using PHP, active directory, while using IE/Firefox
body: <p>This code below checks for the user's credentials against ldap</p>
  
  <pre><code>&lt;?php
  $ldaphost = "ldap.domain.com";
  $ldapport = 389;
  
  $ds = ldap_connect($ldaphost, $ldapport)
  or die("Could not connect to $ldaphost");
  
  if ($ds) 
  {
      $username = "johndoe@domain.com";
      $upasswd = "pass";
  
      $ldapbind = ldap_bind($ds, $username, $upasswd);
  
      if ($ldapbind) 
          {print "Congratulations! $username is authenticated.";}
      else 
          {print "Access Denied!";}
  }
  ?&gt;
  </code></pre>
  
  <p>My users use Firefox and IE, and I know that can pass their ActiveDirectory credentials seamlessly.</p>
  
  <p>I just want to check the AD group to see if that username is found in there, if so, display the page, otherwise prompt to enter in credentials.</p>
  
  <p>Since our users are already logged into the domain controller, I want to grab their username, check to see if it was found in the specific group, then let them in, otherwise prompt user to input credentials. How is this possible?</p>