diff options
Diffstat (limited to 'admin.go')
-rw-r--r-- | admin.go | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -19,9 +19,14 @@ func checkAdminLogin(w http.ResponseWriter, r *http.Request) *LoginStatus { } can_admin := (login.Info.DN == config.AdminAccount) - for _, group := range login.UserEntry.GetAttributeValues("memberof") { - if config.GroupCanAdmin != "" && group == config.GroupCanAdmin { - can_admin = true + fmt.Printf("%#v", login.UserEntry) + for _, attr := range login.UserEntry.Attributes { + if strings.EqualFold(attr.Name, "memberof") { + for _, group := range attr.Values { + if config.GroupCanAdmin != "" && group == config.GroupCanAdmin { + can_admin = true + } + } } } |