Advertisement
Guest User

Untitled

a guest
Feb 4th, 2014
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. use adLDAP\adLDAP;
  3.  
  4. require_once(dirname(__FILE__) . '/../adLDAP/adLDAP.php');
  5.  
  6. session_start();
  7.  
  8. $adldap = new adLDAP(
  9. array(
  10. 'base_dn'=>'DC=capelps,DC=local',
  11. 'account_suffix'=>'@capelps.local',
  12. 'domain_controllers'=>array('STUDENT-DC.capelps.local'),
  13. 'use_ssl'=>true
  14. )
  15. );
  16.  
  17. $username = "administrator";
  18. $password = "mypassword";
  19.  
  20. $authUser = $adldap->user()->authenticate($username, $password);
  21.  
  22. if ($authUser == true) {
  23. echo "User authenticated successfully";
  24. }
  25. else {
  26. echo "User authentication unsuccessful";
  27. }
  28.  
  29. $usernames = $adldap->user()->all();
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement