|
|
|
@@ -35,7 +35,7 @@ func (l LDAPClient) GetAllUsers() (int, gin.H) {
|
|
|
|
|
l.peopledn, // The base dn to search
|
|
|
|
|
ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
|
|
|
|
|
"(&(objectClass=inetOrgPerson))", // The filter to apply
|
|
|
|
|
[]string{"dn", "cn", "sn", "mail", "uid"}, // A list attributes to retrieve
|
|
|
|
|
[]string{"dn", "cn", "sn", "mail", "uid", "memberOf"}, // A list attributes to retrieve
|
|
|
|
|
nil,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@@ -57,6 +57,7 @@ func (l LDAPClient) GetAllUsers() (int, gin.H) {
|
|
|
|
|
"sn": entry.GetAttributeValue("sn"),
|
|
|
|
|
"mail": entry.GetAttributeValue("mail"),
|
|
|
|
|
"uid": entry.GetAttributeValue("uid"),
|
|
|
|
|
"memberOf": entry.GetAttributeValues("memberOf"),
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@@ -104,7 +105,7 @@ func (l LDAPClient) GetUser(uid string) (int, gin.H) {
|
|
|
|
|
fmt.Sprintf("uid=%s,%s", uid, l.peopledn), // The base dn to search
|
|
|
|
|
ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
|
|
|
|
|
"(&(objectClass=inetOrgPerson))", // The filter to apply
|
|
|
|
|
[]string{"dn", "cn", "sn", "mail", "uid"}, // A list attributes to retrieve
|
|
|
|
|
[]string{"dn", "cn", "sn", "mail", "uid", "memberOf"}, // A list attributes to retrieve
|
|
|
|
|
nil,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@@ -124,6 +125,7 @@ func (l LDAPClient) GetUser(uid string) (int, gin.H) {
|
|
|
|
|
"sn": entry.GetAttributeValue("sn"),
|
|
|
|
|
"mail": entry.GetAttributeValue("mail"),
|
|
|
|
|
"uid": entry.GetAttributeValue("uid"),
|
|
|
|
|
"memberOf": entry.GetAttributeValues("memberOf"),
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|