Skip to content

Commit 47c63ff

Browse files
committed
Validate Email before change user's email
1 parent fc5875b commit 47c63ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

routers/web/admin/users.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,13 @@ func EditUserPost(ctx *context.Context) {
298298
ctx.RenderWithErr(errMsg, tplUserNew, &form)
299299
return
300300
}
301+
302+
if err := user_model.ValidateEmail(form.Email); err != nil {
303+
ctx.Data["Err_Email"] = true
304+
ctx.RenderWithErr(ctx.Tr("form.email_error"), tplUserNew, &form)
305+
return
306+
}
307+
301308
if u.Salt, err = user_model.GetUserSalt(); err != nil {
302309
ctx.ServerError("UpdateUser", err)
303310
return

0 commit comments

Comments
 (0)