aboutsummaryrefslogtreecommitdiff
path: root/internal/db
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-27 18:06:38 +0800
committerGitHub <noreply@github.com>2020-02-27 18:06:38 +0800
commit7950f2d17d97c37fca22b88d48056de1c00b4d77 (patch)
tree962531de3ff86417dc06cc4ece6eb22176fb5b8c /internal/db
parentcf3d55fa10f9b16d0ba996f8129f50743b2cd4ad (diff)
conf: overhaul auth and user settings (#5942)
* conf: overhaul auth and user settings * ci: update travis Go versions
Diffstat (limited to 'internal/db')
-rw-r--r--internal/db/issue_mail.go4
-rw-r--r--internal/db/user.go6
2 files changed, 5 insertions, 5 deletions
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