ldapsearch -b "ou=mail aliases,dc=mydomain,dc=com" -D cn=manager,dc=mydomain,dc=com -w 'ch@t!!' "uid=rjm"
####
#this bind worked
#$message = $ldap->bind( $entry->dn(), password => "${password}" );
####
#this bind works, I'm using my personal account and password
#$message = $ldap->bind( 'uid=rjm,ou=people,dc=mydomain,dc=com', password => 'mypass' );
#I'm having trouble binding as manager. Is the syntax correct? This gives me $message->code == LDAP_INVALID_CREDENTIALS
$message = $ldap->bind( 'cn=manager,dc=mydomain,dc=com', password => 'ch\@t!!' ); #\ before @ ok?
if ( $message->code == LDAP_INVALID_CREDENTIALS ) {
print_form("Invalid username or password.");
exit(0);
}
if ( $message->is_error() ) {
die( $message->error() );
}