Support LDAP search by user tag

This commit is contained in:
Yang Luo
2023-05-12 13:03:43 +08:00
parent c33d537ac1
commit 96a3db21a1
4 changed files with 52 additions and 3 deletions

View File

@ -113,6 +113,9 @@ func handleSearch(w ldap.ResponseWriter, m *ldap.Message) {
for _, attr := range r.Attributes() {
e.AddAttribute(message.AttributeDescription(attr), getAttribute(string(attr), user))
if string(attr) == "cn" {
e.AddAttribute(message.AttributeDescription(attr), getAttribute("title", user))
}
}
w.Write(e)