Retrieve ldap entry from user model

This commit is contained in:
Râu Cao
2023-02-25 15:30:23 +08:00
parent 30fb9805e5
commit 678e80a25d
2 changed files with 7 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ class LdapService < ApplicationService
end
attributes = %w{dn cn uid mail admin}
filter = Net::LDAP::Filter.eq("uid", "*")
filter = Net::LDAP::Filter.eq("uid", args[:uid] || "*")
entries = ldap_client.search(base: treebase, filter: filter, attributes: attributes)
entries.sort_by! { |e| e.cn[0] }