Update profile.go
Cette révision appartient à :
Parent
0800924982
révision
9d485e5a77
1 fichiers modifiés avec 7 ajouts et 3 suppressions
|
@ -189,9 +189,13 @@ func UserProfileFormHandler(c *gin.Context) {
|
|||
validator.ValidateForm(&userForm, messages)
|
||||
if !messages.HasErrors() {
|
||||
if userForm.Email != userProfile.Email {
|
||||
email.SendVerificationToUser(currentUser, userForm.Email)
|
||||
messages.AddInfoTf("infos", "email_changed", userForm.Email)
|
||||
userForm.Email = userProfile.Email // reset, it will be set when user clicks verification
|
||||
if currentUser.HasAdmin() {
|
||||
userProfile.Email = userForm.Email
|
||||
} else {
|
||||
email.SendVerificationToUser(currentUser, userForm.Email)
|
||||
messages.AddInfoTf("infos", "email_changed", userForm.Email)
|
||||
userForm.Email = userProfile.Email // reset, it will be set when user clicks verification
|
||||
}
|
||||
}
|
||||
user, _, err := users.UpdateFromRequest(c, &userForm, &userSettingsForm, currentUser, uint(id))
|
||||
if err != nil {
|
||||
|
|
Référencer dans un nouveau ticket