add afunction to rewrite all public keys on admin request

refs #763
This commit is contained in:
fzerorubigd 2014-12-31 21:37:51 +03:30
parent b6272d1803
commit 6643647687
No known key found for this signature in database
GPG key ID: D6EE858AF9D2999A
4 changed files with 38 additions and 17 deletions

View file

@ -118,6 +118,7 @@ const (
CLEAN_INACTIVATE_USER
CLEAN_REPO_ARCHIVES
GIT_GC_REPOS
SYNC_SSH_AUTHORIZED_KEY
)
func Dashboard(ctx *middleware.Context) {
@ -144,6 +145,9 @@ func Dashboard(ctx *middleware.Context) {
case GIT_GC_REPOS:
success = ctx.Tr("admin.dashboard.git_gc_repos_success")
err = models.GitGcRepos()
case SYNC_SSH_AUTHORIZED_KEY:
success = ctx.Tr("admin.dashboard.resync_all_sshkeys_success")
err = models.RewriteAllPublicKeys()
}
if err != nil {