<?php
require_once('Auth.php');
// Authenticating with Active Directory
$auth = new Auth("LDAP", array(
'host' => 'ldap://hostname.domain.com',
'version' => 3,
'binddn' => 'CN=Morpheus,DC=domain',
'bindpw' => 'fishburne',
'basedn' => 'OU=Users,DC=domain',
'userattr' => 'samaccountname',
'userfilter' => '(objectClass=person)',
'start_tls' => 'true'
));
$auth->start();
if ($auth->getAuth()) {
// validated users
print "Welcome to the desert of the real";
} else {
// not yet authenticated
print "Don't think you are, know you are.";
}
$auth->logout();
?>
Posted by admica @ 2 July 2009