This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
log.txt
|
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 {
|
if len(sr.Entries) != 1 {
|
||||||
return nil, fmt.Errorf("user '%s' does not exist", samAccountName)
|
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)
|
||||||
for _, entry := range sr.Entries {
|
groups := entry.GetAttributeValues("memberOf")
|
||||||
//entry.PrettyPrint(2)
|
for _, group := range groups {
|
||||||
fmt.Println(entry.GetAttributeValue("memberOf"))
|
fmt.Println(group)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user