G Pas
This commit is contained in:
parent
11e31a62eb
commit
3a30b52a78
1 changed files with 7 additions and 1 deletions
8
gpas.go
8
gpas.go
|
@ -58,10 +58,16 @@ func passwordLost(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
|
||||||
// Préparation du courriel à envoyer
|
// Préparation du courriel à envoyer
|
||||||
user.Password = suggestPassword()
|
user.Password = suggestPassword()
|
||||||
code := b64.URLEncoding.EncodeToString([]byte(user.UID + ";" + user.Password))
|
code := b64.URLEncoding.EncodeToString([]byte(user.UID + ";" + user.Password))
|
||||||
user.DN = "uid=" + user.UID + ",ou=invitations,dc=resdigita,dc=org"
|
user.DN = "uid=" + searchRes.Entries[0].GetAttributeValue("cn") + ",ou=invitations,dc=resdigita,dc=org"
|
||||||
|
user.UID = searchRes.Entries[0].GetAttributeValue("cn")
|
||||||
|
user.CN = searchRes.Entries[0].GetAttributeValue("cn")
|
||||||
|
user.Mail = searchRes.Entries[0].GetAttributeValue("mail")
|
||||||
|
user.OtherMailbox = searchRes.Entries[0].GetAttributeValue("carLicense")
|
||||||
err = passwd(user, config, ldapConn)
|
err = passwd(user, config, ldapConn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf(fmt.Sprintf("passwordLost : %v", err))
|
log.Printf(fmt.Sprintf("passwordLost : %v", err))
|
||||||
|
log.Printf(fmt.Sprintf("passwordLost : %v", user))
|
||||||
|
log.Printf(fmt.Sprintf("passwordLost : %v", searchRes.Entries[0]))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
templateMail := template.Must(template.ParseFiles(templatePath + "/invite_mail.txt"))
|
templateMail := template.Must(template.ParseFiles(templatePath + "/invite_mail.txt"))
|
||||||
|
|
Loading…
Reference in a new issue