<?php

require_once(dirname(FILE) . '/vtiger/modules/Users/authTypes/adLDAP.php');

try {
    $adldap = new adLDAP();
}

catch (adLDAPException $e) {
    echo "adLDAPException";
    echo $e;
    exit();
}

echo "adldap Object created !\n";

$authUser = $adldap->authenticate('myusername', 'mys3cretPa$$word');
if ($authUser == true) {
  echo "User authenticated successfully\n";
}
else {
  // getLastError is not needed, but may be helpful for finding out why:
  echo "User authentication unsuccessful\n";
  echo $adldap->getLastError();
}
?>

