From 6a7438e3cef66207aea710021280749eb63ff246 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Fri, 21 Jul 2023 15:28:30 +0200 Subject: [PATCH] Implementing Activate User --- admin.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/admin.go b/admin.go index 36af070..00506a0 100644 --- a/admin.go +++ b/admin.go @@ -55,14 +55,19 @@ func handleAdminActivateUsers(w http.ResponseWriter, r *http.Request) { searchRequest := ldap.NewSearchRequest( config.InvitationBaseDN, - ldap.ScopeSingleLevel, ldap.NeverDerefAliases, 0, 0, false, + ldap.ScopeSingleLevel, + ldap.NeverDerefAliases, + 0, + 0, + false, fmt.Sprintf("(&(objectClass=organizationalPerson))"), - []string{config.UserNameAttr, "displayName", "givenName", "sn", "mail", "uid", "cn"}, + []string{"cn", "displayName", "givenName", "sn", "mail", "uid"}, nil) sr, err := login.conn.Search(searchRequest) if err != nil { - log.Printf(fmt.Sprintf("65: %v %v", err, sr)) + log.Printf(fmt.Sprintf("65: %v %v", err, searchRequest)) + log.Printf(fmt.Sprintf("65: %v %v", login, login.conn)) http.Error(w, err.Error(), http.StatusInternalServerError) return }