Working on signup workfow
This commit is contained in:
parent
5f9be02cde
commit
58efdd2fc6
2 changed files with 2 additions and 2 deletions
|
@ -45,8 +45,6 @@ func passwordLost(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
|
|||
searchFilter += ")"
|
||||
searchReq := ldap.NewSearchRequest(config.UserBaseDN, ldap.ScopeSingleLevel, ldap.NeverDerefAliases, 0, 0, false, searchFilter, []string{"cn", "uid", "mail", "carLicense", "sn", "displayName", "givenName"}, nil)
|
||||
searchRes, err := ldapConn.Search(searchReq)
|
||||
log.Printf("passwordLost search : %v", searchReq)
|
||||
log.Printf("passwordLost search : %v", searchRes)
|
||||
if err != nil {
|
||||
log.Printf("passwordLost search : %v %v", err, ldapConn)
|
||||
log.Printf("passwordLost search : %v", searchReq)
|
||||
|
@ -67,6 +65,7 @@ func passwordLost(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
|
|||
// Préparation du courriel à envoyer
|
||||
user.Password = suggestPassword()
|
||||
code := b64.URLEncoding.EncodeToString([]byte(user.UID + ";" + user.Password))
|
||||
|
||||
user.DN = "uid=" + searchRes.Entries[0].GetAttributeValue("cn") + "," + config.InvitationBaseDN
|
||||
user.UID = searchRes.Entries[0].GetAttributeValue("cn")
|
||||
user.CN = searchRes.Entries[0].GetAttributeValue("cn")
|
||||
|
|
|
@ -115,6 +115,7 @@ func add(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
|
|||
// Send the email
|
||||
|
||||
newUserLdapConn, _ := openNewUserLdap(config)
|
||||
user.OtherMailbox = ""
|
||||
err = passwordLost(user, config, newUserLdapConn)
|
||||
if err != nil {
|
||||
log.Printf("add User PasswordLost %v", err)
|
||||
|
|
Loading…
Reference in a new issue