diff options
author | Unknown <joe2010xtmf@163.com> | 2014-06-21 00:51:41 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-06-21 00:51:41 -0400 |
commit | ad5ec45dd63aa2563d113e6a9ce31180246aa5f2 (patch) | |
tree | b49f76a29faeec1bdf734375f91e5291acf09e53 /routers/admin/admin.go | |
parent | 8bfa7ae7453e56191aa6f7de8067d5b6bb5a4a8b (diff) | |
download | gitea-ad5ec45dd63aa2563d113e6a9ce31180246aa5f2.tar.gz gitea-ad5ec45dd63aa2563d113e6a9ce31180246aa5f2.zip |
Fix #165
Diffstat (limited to 'routers/admin/admin.go')
-rw-r--r-- | routers/admin/admin.go | 13 |
1 files changed, 10 insertions, 3 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 |