G Pas
This commit is contained in:
parent
a3732c504b
commit
0fb1a7a0dd
1 changed files with 3 additions and 1 deletions
4
gpas.go
4
gpas.go
|
@ -40,9 +40,10 @@ func passwordLost(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
|
||||||
log.Printf(fmt.Sprintf("passwordLost : %v %v", err, ldapConn))
|
log.Printf(fmt.Sprintf("passwordLost : %v %v", err, ldapConn))
|
||||||
log.Printf(fmt.Sprintf("passwordLost : %v", searchReq))
|
log.Printf(fmt.Sprintf("passwordLost : %v", searchReq))
|
||||||
log.Printf(fmt.Sprintf("passwordLost : %v", user))
|
log.Printf(fmt.Sprintf("passwordLost : %v", user))
|
||||||
return errors.New("LDAP chose")
|
return errors.New("Chose LDAP")
|
||||||
}
|
}
|
||||||
if len(searchRes.Entries) == 0 {
|
if len(searchRes.Entries) == 0 {
|
||||||
|
log.Printf("Il n'y a pas d'utilisateur qui correspond")
|
||||||
return errors.New("Il n'y a pas d'utilisateur qui correspond")
|
return errors.New("Il n'y a pas d'utilisateur qui correspond")
|
||||||
}
|
}
|
||||||
// Préparation du courriel à envoyer
|
// Préparation du courriel à envoyer
|
||||||
|
@ -66,6 +67,7 @@ func passwordLost(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
|
||||||
log.Printf("auth: %v", auth)
|
log.Printf("auth: %v", auth)
|
||||||
err = smtp.SendMail(config.SMTPServer+":587", auth, config.SMTPUsername, []string{user.OtherMailbox}, message)
|
err = smtp.SendMail(config.SMTPServer+":587", auth, config.SMTPUsername, []string{user.OtherMailbox}, message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Printf("email send error %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Printf("Mail sent.")
|
log.Printf("Mail sent.")
|
||||||
|
|
Loading…
Reference in a new issue