From 7950f2d17d97c37fca22b88d48056de1c00b4d77 Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Thu, 27 Feb 2020 18:06:38 +0800 Subject: conf: overhaul auth and user settings (#5942) * conf: overhaul auth and user settings * ci: update travis Go versions --- internal/db/issue_mail.go | 4 ++-- internal/db/user.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/db') diff --git a/internal/db/issue_mail.go b/internal/db/issue_mail.go index e14603c6..c9b5471a 100644 --- a/internal/db/issue_mail.go +++ b/internal/db/issue_mail.go @@ -10,9 +10,9 @@ import ( "github.com/unknwon/com" log "unknwon.dev/clog/v2" + "gogs.io/gogs/internal/conf" "gogs.io/gogs/internal/email" "gogs.io/gogs/internal/markup" - "gogs.io/gogs/internal/conf" ) func (issue *Issue) MailSubject() string { @@ -95,7 +95,7 @@ func NewMailerIssue(issue *Issue) email.Issue { // 1. Repository watchers, users who participated in comments and the assignee. // 2. Users who are not in 1. but get mentioned in current issue/comment. func mailIssueCommentToParticipants(issue *Issue, doer *User, mentions []string) error { - if !conf.Service.EnableNotifyMail { + if !conf.User.EnableEmailNotification { return nil } diff --git a/internal/db/user.go b/internal/db/user.go index ed43bc52..adaac99b 100644 --- a/internal/db/user.go +++ b/internal/db/user.go @@ -202,7 +202,7 @@ func (u *User) HTMLURL() string { func (u *User) GenerateEmailActivateCode(email string) string { code := tool.CreateTimeLimitCode( com.ToStr(u.ID)+email+u.LowerName+u.Passwd+u.Rands, - conf.Service.ActiveCodeLives, nil) + conf.Auth.ActivateCodeLives, nil) // Add tail hex username code += hex.EncodeToString([]byte(u.LowerName)) @@ -617,7 +617,7 @@ func parseUserFromCode(code string) (user *User) { // verify active code when active account func VerifyUserActiveCode(code string) (user *User) { - minutes := conf.Service.ActiveCodeLives + minutes := conf.Auth.ActivateCodeLives if user = parseUserFromCode(code); user != nil { // time limit code @@ -633,7 +633,7 @@ func VerifyUserActiveCode(code string) (user *User) { // verify active code when active account func VerifyActiveEmailCode(code, email string) *EmailAddress { - minutes := conf.Service.ActiveCodeLives + minutes := conf.Auth.ActivateCodeLives if user := parseUserFromCode(code); user != nil { // time limit code -- cgit v1.2.3