This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
log.txt
|
||||
*.pem
|
||||
*.pem
|
||||
authcheck
|
15
main.go
15
main.go
@@ -87,13 +87,16 @@ func GetGroupsOfUser(username string, baseDN string, conn *ldap.Conn) ([]string,
|
||||
|
||||
if len(sr.Entries) != 1 {
|
||||
return nil, fmt.Errorf("user '%s' does not exist", samAccountName)
|
||||
}
|
||||
} else {
|
||||
//sr.PrettyPrint(2)
|
||||
|
||||
sr.PrettyPrint(2)
|
||||
|
||||
for _, entry := range sr.Entries {
|
||||
//entry.PrettyPrint(2)
|
||||
fmt.Println(entry.GetAttributeValue("memberOf"))
|
||||
for _, entry := range sr.Entries {
|
||||
//entry.PrettyPrint(2)
|
||||
groups := entry.GetAttributeValues("memberOf")
|
||||
for _, group := range groups {
|
||||
fmt.Println(group)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user