]> source.dussan.org Git - gitea.git/commit
Fix activation of primary email addresses (#16385)
authorMeano <Meano@foxmail.com>
Tue, 13 Jul 2021 20:59:27 +0000 (04:59 +0800)
committerGitHub <noreply@github.com>
Tue, 13 Jul 2021 20:59:27 +0000 (22:59 +0200)
commit423a0fccb6df5a1e12d70719cb9e28164b28428a
tree9619f5a44d25a947a3f1abb807a9416afeb789d4
parent56b7f53329afa913055f5157537614b80d2d4e30
Fix activation of primary email addresses (#16385)

* fix: primary email cannot be activated

* Primary email should be activated together with user account when
'RegisterEmailConfirm' is enabled.

* To fix the existing error state. When 'RegisterEmailConfirm' is enabled, the
admin should have permission to modify the activations status of user email.
And the user should be allowed to send activation to primary email.

* Only judge whether email is primary from email_address table.

* Improve logging and refactor isEmailActive

Co-authored-by: zeripath <art27@cantab.net>
models/user_mail.go
routers/web/admin/emails.go
routers/web/user/auth.go
routers/web/user/setting/account.go
templates/user/settings/account.tmpl