diff --git a/model-user.go b/model-user.go index 229bb38..9bbb5c5 100644 --- a/model-user.go +++ b/model-user.go @@ -147,6 +147,7 @@ func modify(user User, config *ConfigFile, ldapConn *ldap.Conn) error { replaceIfContent(modify_request, "displayName", user.DisplayName, previousUser.DisplayName) replaceIfContent(modify_request, "givenName", user.GivenName, previousUser.GivenName) replaceIfContent(modify_request, "sn", user.SN, previousUser.SN) + replaceIfContent(modify_request, "carLicense", user.OtherMailbox, user.OtherMailbox) replaceIfContent(modify_request, "description", user.Description, previousUser.Description) err = ldapConn.Modify(modify_request) if err != nil { diff --git a/templates/admin/create.html b/templates/admin/create.html index 44a75a6..259051e 100644 --- a/templates/admin/create.html +++ b/templates/admin/create.html @@ -58,6 +58,11 @@ +
+ + +
+
diff --git a/view-admin.go b/view-admin.go index 6ff4f53..b30b269 100644 --- a/view-admin.go +++ b/view-admin.go @@ -937,6 +937,7 @@ func handleAdminCreate(w http.ResponseWriter, r *http.Request) { data.Member = strings.TrimSpace(strings.Join(r.Form["member"], "")) data.Description = strings.TrimSpace(strings.Join(r.Form["description"], "")) data.SN = strings.TrimSpace(strings.Join(r.Form["sn"], "")) + data.OtherMailbox = strings.TrimSpace(strings.Join(r.Form["othermailbox"], "")) object_class := []string{} for _, oc := range strings.Split(data.ObjectClass, "\n") { @@ -993,6 +994,9 @@ func handleAdminCreate(w http.ResponseWriter, r *http.Request) { newUser.SN = data.SN // req.Attribute("sn", []string{data.SN}) } + if data.OtherMailbox != "" { + newUser.OtherMailbox = data.OtherMailbox + } if data.Description != "" { newUser.Description = data.Description // req.Attribute("description", []string{data.Description}) diff --git a/view-invite.go b/view-invite.go index d98e2d3..bc5fed3 100644 --- a/view-invite.go +++ b/view-invite.go @@ -201,6 +201,7 @@ func handleNewAccount(w http.ResponseWriter, r *http.Request, l *ldap.Conn, invi newUser.DisplayName = strings.TrimSpace(strings.Join(r.Form["displayname"], "")) newUser.GivenName = strings.TrimSpace(strings.Join(r.Form["givenname"], "")) newUser.SN = strings.TrimSpace(strings.Join(r.Form["surname"], "")) + newUser.OtherMailbox = strings.TrimSpace(strings.Join(r.Form["othermailbox"], "")) newUser.Mail = strings.TrimSpace(strings.Join(r.Form["mail"], "")) newUser.UID = strings.TrimSpace(strings.Join(r.Form["othermailbox"], "")) newUser.CN = strings.TrimSpace(strings.Join(r.Form["username"], "")) diff --git a/view.go b/view.go index 99bf30a..3c1544b 100644 --- a/view.go +++ b/view.go @@ -113,6 +113,7 @@ type CreateData struct { StructuralObjectClass string ObjectClass string SN string + OtherMailbox string Common NestedCommonTplData Login NestedLoginTplData