restrict email parameter to users with EditUserEmail perm

This commit is contained in:
Azareal 2021-01-19 12:48:49 +10:00
parent c9e99c075d
commit 033ddb185d
1 changed files with 3 additions and 0 deletions

View File

@ -18,6 +18,9 @@ func Users(w http.ResponseWriter, r *http.Request, u *c.User) c.RouteError {
name := r.FormValue("s-name")
email := r.FormValue("s-email")
if !u.Perms.EditUserEmail && email != "" {
email = ""
}
hasParam := name != "" || email != ""
page, _ := strconv.Atoi(r.FormValue("page"))