Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CN=Bob Smith,OU=Accounting,DC=mydomain,DC=net
- DC=mydomain,DC=net
- $connectionLDAP = "LDAP://localhost:54126";
- $basedn = 'DC=mydomain,DC=net';
- $ldap = ldap_connect($connectionLDAP) or die("Could not connect to LDAP server.");
- $username = $post['username'];
- $password = $post['password'];
- $usernameForBind = "CN=".$username.",OU=Accounting,".$basedn;
- ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
- ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
- $bind = ldap_bind($ldap, $usernameForBind, $password);
- Warning: ldap_bind(): Unable to bind to server: Invalid credentials in C:....login.php on line 41
- echo(ldap_error($ldap)."<br>");
- echo(ldap_errno($ldap)."<br>");
- Invalid credentials
- 49
- $connectionLDAP = "ldap://localhost";
- $basedn = '@mydomain.net';
- $ldap = ldap_connect($connectionLDAP, 54126) or die("Could not connect to LDAP server.");
- $username = $post['username'];
- $password = $post['password'];
- $usernameForBind = $username.$basedn;
- ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
- ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
- $bind = ldap_bind($ldap, $usernameForBind, $password);
Add Comment
Please, Sign In to add comment