Working on signup workfow

This commit is contained in:
Chris Mann 2023-07-26 14:38:04 +02:00
parent 6be99fe3cb
commit dd911ca11b
2 changed files with 5 additions and 3 deletions

View file

@ -164,8 +164,10 @@ func modify(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
func passwd(user User, config *ConfigFile, ldapConn *ldap.Conn) error { func passwd(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
passwordModifyRequest := ldap.NewPasswordModifyRequest(user.DN, "", user.Password) passwordModifyRequest := ldap.NewPasswordModifyRequest(user.DN, "", user.Password)
_, err := ldapConn.PasswordModify(passwordModifyRequest) _, err := ldapConn.PasswordModify(passwordModifyRequest)
log.Printf(fmt.Sprintf("passwd 162 : %v %v", err, ldapConn)) if err != nil {
log.Printf(fmt.Sprintf("passwd 163 : %v", user)) log.Printf(fmt.Sprintf("model-user passwd : %v %v", err, ldapConn))
log.Printf(fmt.Sprintf("model-user passwd : %v", user))
}
return err return err
} }

View file

@ -157,7 +157,7 @@ func handleNewAccount(w http.ResponseWriter, r *http.Request, l *ldap.Conn, invi
newUser.SN = strings.TrimSpace(strings.Join(r.Form["surname"], "")) newUser.SN = strings.TrimSpace(strings.Join(r.Form["surname"], ""))
newUser.OtherMailbox = strings.TrimSpace(strings.Join(r.Form["othermailbox"], "")) newUser.OtherMailbox = strings.TrimSpace(strings.Join(r.Form["othermailbox"], ""))
newUser.Mail = strings.TrimSpace(strings.Join(r.Form["mail"], "")) newUser.Mail = strings.TrimSpace(strings.Join(r.Form["mail"], ""))
newUser.UID = strings.TrimSpace(strings.Join(r.Form["othermailbox"], "")) newUser.UID = strings.TrimSpace(strings.Join(r.Form["username"], ""))
newUser.CN = strings.TrimSpace(strings.Join(r.Form["username"], "")) newUser.CN = strings.TrimSpace(strings.Join(r.Form["username"], ""))
newUser.DN = "cn=" + strings.TrimSpace(strings.Join(r.Form["username"], "")) + "," + config.UserBaseDN newUser.DN = "cn=" + strings.TrimSpace(strings.Join(r.Form["username"], "")) + "," + config.UserBaseDN