Refactoring

This commit is contained in:
Chris Mann 2023-07-26 10:41:21 +02:00
parent 0418d7be7d
commit 7f1073e258

View file

@ -105,17 +105,16 @@ func add(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
err := ldapConn.Add(req) err := ldapConn.Add(req)
if err != nil { if err != nil {
log.Printf(fmt.Sprintf("71: %v", err)) log.Printf(fmt.Sprintf("add(User) ldapconn.Add: %v", err))
log.Printf(fmt.Sprintf("72: %v", req)) log.Printf(fmt.Sprintf("add(User) ldapconn.Add: %v", req))
log.Printf(fmt.Sprintf("73: %v", user)) log.Printf(fmt.Sprintf("add(User) ldapconn.Add: %v", user))
return err //return err
} else { }
passwordModifyRequest := ldap.NewPasswordModifyRequest(user.DN, "", user.Password) passwordModifyRequest := ldap.NewPasswordModifyRequest(user.DN, "", user.Password)
_, err = ldapConn.PasswordModify(passwordModifyRequest) _, err = ldapConn.PasswordModify(passwordModifyRequest)
if err != nil { if err != nil {
return err return err
} }
}
// Send the email // Send the email
err = sendMail(SendMailTplData{ err = sendMail(SendMailTplData{
From: "alice@resdigita.org", From: "alice@resdigita.org",