diff --git a/pkg/service/v0/data/user.go b/pkg/service/v0/data/user.go index 015b9a33f..c33d878a9 100644 --- a/pkg/service/v0/data/user.go +++ b/pkg/service/v0/data/user.go @@ -8,14 +8,15 @@ type Users struct { // User holds the payload for a GetUser response type User struct { // TODO needs better naming, clarify if we need a userid, a username or both - Enabled string `json:"enabled" xml:"enabled"` - UserID string `json:"id" xml:"id"` - Username string `json:"username" xml:"username"` - DisplayName string `json:"displayname" xml:"displayname"` - Email string `json:"email" xml:"email"` - Quota *Quota `json:"quota" xml:"quota"` - UIDNumber int64 `json:"uidnumber" xml:"uidnumber"` - GIDNumber int64 `json:"gidnumber" xml:"gidnumber"` + Enabled string `json:"enabled" xml:"enabled"` + UserID string `json:"id" xml:"id"` + Username string `json:"username" xml:"username"` + DisplayName string `json:"display-name" xml:"display-name"` + LegacyDisplayName string `json:"displayname" xml:"displayname"` + Email string `json:"email" xml:"email"` + Quota *Quota `json:"quota" xml:"quota"` + UIDNumber int64 `json:"uidnumber" xml:"uidnumber"` + GIDNumber int64 `json:"gidnumber" xml:"gidnumber"` } // Quota holds quota information diff --git a/pkg/service/v0/users.go b/pkg/service/v0/users.go index eb2fd5ce2..05027fdc8 100644 --- a/pkg/service/v0/users.go +++ b/pkg/service/v0/users.go @@ -63,14 +63,16 @@ func (o Ocs) GetUser(w http.ResponseWriter, r *http.Request) { } else { enabled = "false" } + render.Render(w, r, response.DataRender(&data.User{ - UserID: account.Id, // TODO userid vs username! implications for clients if we return the userid here? -> implement graph ASAP? - Username: account.PreferredName, - DisplayName: account.DisplayName, - Email: account.Mail, - UIDNumber: account.UidNumber, - GIDNumber: account.GidNumber, - Enabled: enabled, + UserID: account.Id, // TODO userid vs username! implications for clients if we return the userid here? -> implement graph ASAP? + Username: account.PreferredName, + DisplayName: account.DisplayName, + LegacyDisplayName: account.DisplayName, + Email: account.Mail, + UIDNumber: account.UidNumber, + GIDNumber: account.GidNumber, + Enabled: enabled, // FIXME onlyfor users/{userid} endpoint (not /user) // TODO query storage registry for free space? of home storage, maybe... Quota: &data.Quota{ @@ -175,13 +177,14 @@ func (o Ocs) AddUser(w http.ResponseWriter, r *http.Request) { enabled = "false" } render.Render(w, r, response.DataRender(&data.User{ - UserID: account.Id, - Username: account.PreferredName, - DisplayName: account.DisplayName, - Email: account.Mail, - UIDNumber: account.UidNumber, - GIDNumber: account.UidNumber, - Enabled: enabled, + UserID: account.Id, + Username: account.PreferredName, + DisplayName: account.DisplayName, + LegacyDisplayName: account.DisplayName, + Email: account.Mail, + UIDNumber: account.UidNumber, + GIDNumber: account.UidNumber, + Enabled: enabled, })) }