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 += ")"
|
searchFilter += ")"
|
||||||
searchReq := ldap.NewSearchRequest(config.UserBaseDN, ldap.ScopeSingleLevel, ldap.NeverDerefAliases, 0, 0, false, searchFilter, []string{"cn", "uid", "mail", "carLicense", "sn", "displayName", "givenName"}, nil)
|
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)
|
searchRes, err := ldapConn.Search(searchReq)
|
||||||
log.Printf("passwordLost search : %v", searchReq)
|
|
||||||
log.Printf("passwordLost search : %v", searchRes)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("passwordLost search : %v %v", err, ldapConn)
|
log.Printf("passwordLost search : %v %v", err, ldapConn)
|
||||||
log.Printf("passwordLost search : %v", searchReq)
|
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
|
// 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=" + searchRes.Entries[0].GetAttributeValue("cn") + "," + config.InvitationBaseDN
|
user.DN = "uid=" + searchRes.Entries[0].GetAttributeValue("cn") + "," + config.InvitationBaseDN
|
||||||
user.UID = searchRes.Entries[0].GetAttributeValue("cn")
|
user.UID = searchRes.Entries[0].GetAttributeValue("cn")
|
||||||
user.CN = 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
|
// Send the email
|
||||||
|
|
||||||
newUserLdapConn, _ := openNewUserLdap(config)
|
newUserLdapConn, _ := openNewUserLdap(config)
|
||||||
|
user.OtherMailbox = ""
|
||||||
err = passwordLost(user, config, newUserLdapConn)
|
err = passwordLost(user, config, newUserLdapConn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("add User PasswordLost %v", err)
|
log.Printf("add User PasswordLost %v", err)
|
||||||
|
|
Loading…
Reference in a new issue