LDAP local placeholder should return username when its not an email address (closes #1784)

This commit is contained in:
mdecimus 2025-07-13 12:32:05 +02:00
parent 4c954c93bd
commit 6e62f306ab

View file

@ -58,9 +58,12 @@ impl LdapFilter {
LdapFilterItem::Static(s) => result.push_str(s),
LdapFilterItem::Full => result.push_str(ldap_escape(value).as_ref()),
LdapFilterItem::LocalPart => {
if let Some((value, _)) = value.rsplit_once('@') {
result.push_str(value);
}
result.push_str(
value
.rsplit_once('@')
.map(|(local, _)| local)
.unwrap_or(value),
);
}
LdapFilterItem::DomainPart => {
if let Some((_, domain)) = value.rsplit_once('@') {