mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
fix: support LDAP in linux (#2500)
Co-authored-by: Xiang Zhen Gan <m1353825@163.com>
This commit is contained in:
parent
5b151f4ec4
commit
6c72f86d03
@ -115,7 +115,8 @@ func handleSearch(w ldap.ResponseWriter, m *ldap.Message) {
|
|||||||
for _, user := range users {
|
for _, user := range users {
|
||||||
dn := fmt.Sprintf("cn=%s,%s", user.Name, string(r.BaseObject()))
|
dn := fmt.Sprintf("cn=%s,%s", user.Name, string(r.BaseObject()))
|
||||||
e := ldap.NewSearchResultEntry(dn)
|
e := ldap.NewSearchResultEntry(dn)
|
||||||
|
e.AddAttribute(message.AttributeDescription("uid"), message.AttributeValue(user.Id))
|
||||||
|
e.AddAttribute(message.AttributeDescription("cn"), message.AttributeValue(user.Name))
|
||||||
for _, attr := range r.Attributes() {
|
for _, attr := range r.Attributes() {
|
||||||
e.AddAttribute(message.AttributeDescription(attr), getAttribute(string(attr), user))
|
e.AddAttribute(message.AttributeDescription(attr), getAttribute(string(attr), user))
|
||||||
if string(attr) == "cn" {
|
if string(attr) == "cn" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user