Commit 464584c6 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

fix(auth): search in LDAP by uid and cn by default

parent bccee0be
......@@ -415,7 +415,15 @@ sub _login_bind {
my ($username, $password) = ($self->name , $self->password);
my $found = 0;
for my $user (search_user( name => $self->name )) {
my @user;
if (exists $$CONFIG->{ldap}->{field} && defined $$CONFIG->{ldap}->{field} ) {
@user = search_user( name => $self->name );
} else {
@user = (search_user(name => $self->name, field => 'uid')
,search_user(name => $self->name, field => 'cn'));
}
for my $user (@user) {
my $dn = $user->dn;
$found++;
my $mesg = $LDAP_ADMIN->bind($dn, password => $password);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment