Advertisement
Guest User

Untitled

a guest
Oct 4th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2.  
  3. $ldap = ldap_connect("ldap.example.com");
  4.  
  5. $user = "exampleUser";
  6. $pass = "examplePass";
  7.  
  8. if($bind = ldap_bind($ldap, $user, $pass)) {
  9. // logged in
  10. } else {
  11. // error message
  12. }
  13.  
  14. ?>
  15.  
  16. copy "C:wampbinphpphp5.4.16libsasl.dll" "C:wampbinapacheapache2.4.4binlibsasl.dll"
  17.  
  18. ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
  19. ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
  20. ldap_set_option($ldap, LDAP_OPT_DEBUG_LEVEL, 7);
  21.  
  22. if(!$ldap){
  23. echo "LDAP Failed To Connect: ".ldap_error($ldap);
  24. }
  25.  
  26. SET PATH=C:wampbinphpphp5.3.13;%PATH%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement