diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm index 98ad9c6be..7330cf3bc 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/UserDBLDAP.pm @@ -80,7 +80,7 @@ sub search { $self->lmLog( 'LDAP Search error: ' . $mesg->error, 'error' ); return PE_LDAPERROR; } - unless ( $mesg->count() == 1 ) { + if ( $mesg->count() > 1 ) { $self->lmLog( 'More than one entry returned by LDAP directory', 'error' ); return PE_BADCREDENTIALS;