show email when token has manageusers

This commit is contained in:
Morgan Bazalgette 2017-11-21 15:53:23 +01:00
parent 8d92df534c
commit 0cb01f6067
No known key found for this signature in database
GPG Key ID: 40D328300D245DA5

View File

@ -199,6 +199,7 @@ type userFullResponse struct {
SilenceInfo silenceInfo `json:"silence_info"`
CMNotes *string `json:"cm_notes,omitempty"`
BanDate *common.UnixTimestamp `json:"ban_date,omitempty"`
Email string `json:"email,omitempty"`
}
type silenceInfo struct {
Reason string `json:"reason"`
@ -239,7 +240,7 @@ SELECT
users_stats.avg_accuracy_mania, users_stats.pp_mania,
users.silence_reason, users.silence_end,
users.notes, users.ban_datetime
users.notes, users.ban_datetime, users.email
FROM users
LEFT JOIN users_stats
@ -279,7 +280,7 @@ LIMIT 1
&r.Mania.Accuracy, &r.Mania.PP,
&r.SilenceInfo.Reason, &r.SilenceInfo.End,
&r.CMNotes, &r.BanDate,
&r.CMNotes, &r.BanDate, &r.Email,
)
switch {
case err == sql.ErrNoRows:
@ -324,6 +325,7 @@ LIMIT 1
if md.User.TokenPrivileges&common.PrivilegeManageUser == 0 {
r.CMNotes = nil
r.BanDate = nil
r.Email = ""
}
r.Code = 200