Implementing Activate User

This commit is contained in:
Chris Mann 2023-07-21 15:28:30 +02:00
parent ecd866f0d7
commit 6a7438e3ce

View file

@ -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
}