summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/admin/admin.go13
-rw-r--r--routers/repo/issue.go4
-rw-r--r--routers/repo/setting.go2
3 files changed, 13 insertions, 6 deletions
diff --git a/routers/admin/admin.go b/routers/admin/admin.go
index a14ffae0e5..1567a3001a 100644
--- a/routers/admin/admin.go
+++ b/routers/admin/admin.go
@@ -102,8 +102,11 @@ func updateSystemStatus() {
}
// Operation types.
+type AdminOperation int
+
const (
- OT_CLEAN_OAUTH = iota + 1
+ CLEAN_UNBIND_OAUTH AdminOperation = iota + 1
+ CLEAN_INACTIVATE_USER
)
func Dashboard(ctx *middleware.Context) {
@@ -116,10 +119,13 @@ func Dashboard(ctx *middleware.Context) {
var err error
var success string
- switch op {
- case OT_CLEAN_OAUTH:
+ switch AdminOperation(op) {
+ case CLEAN_UNBIND_OAUTH:
success = "All unbind OAuthes have been deleted."
err = models.CleanUnbindOauth()
+ case CLEAN_INACTIVATE_USER:
+ success = "All inactivate accounts have been deleted."
+ err = models.DeleteInactivateUsers()
}
if err != nil {
@@ -190,6 +196,7 @@ func Config(ctx *middleware.Context) {
ctx.Data["StaticRootPath"] = setting.StaticRootPath
ctx.Data["LogRootPath"] = setting.LogRootPath
ctx.Data["ScriptType"] = setting.ScriptType
+ ctx.Data["ReverseProxyAuthUid"] = setting.ReverseProxyAuthUid
ctx.Data["Service"] = setting.Service
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 808fb52b41..11c573f5cc 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -250,7 +250,7 @@ func CreateIssuePost(ctx *middleware.Context, params martini.Params, form auth.C
}
// Mail watchers and mentions.
- if setting.Service.NotifyMail {
+ if setting.Service.EnableNotifyMail {
tos, err := mailer.SendIssueNotifyMail(ctx.User, ctx.Repo.Owner, ctx.Repo.Repository, issue)
if err != nil {
ctx.Handle(500, "issue.CreateIssue(SendIssueNotifyMail)", err)
@@ -685,7 +685,7 @@ func Comment(ctx *middleware.Context, params martini.Params) {
}
// Mail watchers and mentions.
- if setting.Service.NotifyMail {
+ if setting.Service.EnableNotifyMail {
issue.Content = content
tos, err := mailer.SendIssueNotifyMail(ctx.User, ctx.Repo.Owner, ctx.Repo.Repository, issue)
if err != nil {
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index ac9ce7c77c..6313971c24 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -192,7 +192,7 @@ func CollaborationPost(ctx *middleware.Context) {
return
}
- if setting.Service.NotifyMail {
+ if setting.Service.EnableNotifyMail {
if err = mailer.SendCollaboratorMail(ctx.Render, u, ctx.User, ctx.Repo.Repository); err != nil {
ctx.Handle(500, "setting.CollaborationPost(SendCollaboratorMail)", err)
return