Refactoring
This commit is contained in:
parent
0418d7be7d
commit
7f1073e258
1 changed files with 8 additions and 9 deletions
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue