Skip to content

Commit

Permalink
feat: global kill switch for sharedataovermail
Browse files Browse the repository at this point in the history
  • Loading branch information
puni9869 committed Nov 10, 2024
1 parent be5ad74 commit 7daa0db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/local.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}
},
"enableSsl": false,
"shareDataOverMail": false,
"shareDataOverMail": true,
"authentication": {
"enableLogin": true,
"enableRegistration": true,
Expand Down
4 changes: 1 addition & 3 deletions server/setting/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func Setting(c *gin.Context) {
tmplCtx := make(map[string]string)
email := currentlyLoggedIn.(string)
if currentlyLoggedIn != nil && len(email) > 0 {
tmplCtx["ShareDataOverMail"] = fmt.Sprintf("%t", config.C.ShareDataOverMail)
tmplCtx["Email"] = currentlyLoggedIn.(string)
var user *models.User
result := database.Db().First(&user, "email = ?", email)
Expand All @@ -34,9 +35,6 @@ func Setting(c *gin.Context) {
tmplCtx["DisplayName"] = user.DisplayName
}
}
if !config.C.ShareDataOverMail {
tmplCtx["ShareDataOverMail"] = fmt.Sprintf("%t", config.C.ShareDataOverMail)
}
c.HTML(http.StatusOK, "setting.tmpl", tmplCtx)
}

Expand Down

0 comments on commit 7daa0db

Please sign in to comment.