Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ldaprdn = 'myusername'; // ldap rdn or dn
- $ldappass = 'mypassword';
- // connect to ldap server
- $ldapconn = ldap_connect("LDAP://myDomain")
- or die("Could not connect to LDAP server.");
- ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
- ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);
- if ($ldapconn) {
- var_dump(ldap_bind($ldapconn, $ldaprdn, $ldappass));
- if ($ldapbind) {
- echo "LDAP bind successful...";
- } else {
- echo ldap_error($ldapconn);
- echo "LDAP bind failed...";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement