mirror of
				https://github.com/casdoor/casdoor.git
				synced 2025-11-04 04:33:08 +08:00 
			
		
		
		
	fix: support LDAP in linux (#2500)
Co-authored-by: Xiang Zhen Gan <m1353825@163.com>
This commit is contained in:
		@ -115,7 +115,8 @@ func handleSearch(w ldap.ResponseWriter, m *ldap.Message) {
 | 
			
		||||
	for _, user := range users {
 | 
			
		||||
		dn := fmt.Sprintf("cn=%s,%s", user.Name, string(r.BaseObject()))
 | 
			
		||||
		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() {
 | 
			
		||||
			e.AddAttribute(message.AttributeDescription(attr), getAttribute(string(attr), user))
 | 
			
		||||
			if string(attr) == "cn" {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user