Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <?php
  2. $server = "dc.foo.com";
  3. $username = "katie";
  4. $password = "katiespassword";
  5.  
  6. ad_auth($server, $username, $password);
  7.  
  8. function ad_auth( $server, $username, $password ){
  9. $ldap = @ldap_connect( $server );
  10.  
  11. if ( @ldap_bind( $ldap, $username, $password ) ){
  12. ldap_unbind( $ldap );
  13. echo("yay");
  14. return 1;
  15. }
  16. else{
  17. echo("boo");
  18. return 0;
  19. }
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement