From 0cb01f60673af52a0f0c2dfba57dfd5f6899a36a Mon Sep 17 00:00:00 2001 From: Morgan Bazalgette Date: Tue, 21 Nov 2017 15:53:23 +0100 Subject: [PATCH] show email when token has manageusers --- app/v1/user.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/v1/user.go b/app/v1/user.go index df26e69..1c88a55 100644 --- a/app/v1/user.go +++ b/app/v1/user.go @@ -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