Mercurial > gemma
diff controllers/user.go @ 327:363983d5c567
Allow Waterway User to update a limited set of profile attributes
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 02 Aug 2018 19:25:30 +0200 |
parents | a7b2db8b3d18 |
children | 003243ec5ce5 |
line wrap: on
line diff
--- a/controllers/user.go Thu Aug 02 18:39:01 2018 +0200 +++ b/controllers/user.go Thu Aug 02 19:25:30 2018 +0200 @@ -15,6 +15,10 @@ createUserExtentSQL = `SELECT sys_admin.create_user($1, $2, $3, $4, ST_MakeBox2D(ST_Point($5, $6), ST_Point($7, $8)), $9)` + updateUserUnprivSQL = `UPDATE users.list_users + SET (pw, map_extent, email_address) + = ($2, ST_MakeBox2D(ST_Point($3, $4), ST_Point($5, $6)), $7) + WHERE username = $1` updateUserSQL = `UPDATE users.list_users SET (rolname, username, pw, country, map_extent, email_address) = ($2, $3, $4, $5, NULL, $6) @@ -112,7 +116,14 @@ ) } } else { - // ... + res, err = db.Exec( + updateUserUnprivSQL, + user, + newUser.Password, + newUser.Extent.X1, newUser.Extent.Y1, + newUser.Extent.X2, newUser.Extent.Y2, + newUser.Email, + ) } if err != nil {