mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add some log
This commit is contained in:
@@ -7,6 +7,7 @@ package repo
|
||||
import (
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
)
|
||||
|
||||
@@ -23,6 +24,7 @@ func Create(ctx *middleware.Context, form auth.CreateRepoForm) {
|
||||
_, err := models.CreateRepository(ctx.User, form.RepoName, form.Description,
|
||||
form.Language, form.License, form.Visibility == "private", form.InitReadme == "on")
|
||||
if err == nil {
|
||||
log.Trace("%s Repository created: %s/%s", ctx.Req.RequestURI, ctx.User.LowerName, form.RepoName)
|
||||
ctx.Render.Redirect("/"+ctx.User.Name+"/"+form.RepoName, 302)
|
||||
return
|
||||
} else if err == models.ErrRepoAlreadyExist {
|
||||
@@ -48,6 +50,7 @@ func SettingPost(ctx *middleware.Context) {
|
||||
|
||||
if err := models.DeleteRepository(ctx.User.Id, ctx.Repo.Repository.Id, ctx.User.LowerName); err != nil {
|
||||
ctx.Handle(200, "repo.Delete", err)
|
||||
log.Trace("%s Repository deleted: %s/%s", ctx.Req.RequestURI, ctx.User.LowerName, ctx.Repo.Repository.LowerName)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@@ -46,6 +46,7 @@ func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) {
|
||||
|
||||
ctx.Data["IsSuccess"] = true
|
||||
ctx.Render.HTML(200, "user/setting", ctx.Data)
|
||||
log.Trace("%s User setting updated: %s", ctx.Req.RequestURI, ctx.User.LowerName)
|
||||
}
|
||||
|
||||
func SettingPassword(ctx *middleware.Context, form auth.UpdatePasswdForm) {
|
||||
@@ -82,6 +83,7 @@ func SettingPassword(ctx *middleware.Context, form auth.UpdatePasswdForm) {
|
||||
|
||||
ctx.Data["Owner"] = user
|
||||
ctx.Render.HTML(200, "user/password", ctx.Data)
|
||||
log.Trace("%s User password updated: %s", ctx.Req.RequestURI, ctx.User.LowerName)
|
||||
}
|
||||
|
||||
func SettingSSHKeys(ctx *middleware.Context, form auth.AddSSHKeyForm) {
|
||||
@@ -112,6 +114,7 @@ func SettingSSHKeys(ctx *middleware.Context, form auth.AddSSHKeyForm) {
|
||||
"err": err.Error(),
|
||||
})
|
||||
} else {
|
||||
log.Trace("%s User SSH key deleted: %s", ctx.Req.RequestURI, ctx.User.LowerName)
|
||||
ctx.Render.JSON(200, map[string]interface{}{
|
||||
"ok": true,
|
||||
})
|
||||
@@ -137,6 +140,7 @@ func SettingSSHKeys(ctx *middleware.Context, form auth.AddSSHKeyForm) {
|
||||
return
|
||||
}
|
||||
ctx.Handle(200, "ssh.AddPublicKey", err)
|
||||
log.Trace("%s User SSH key added: %s", ctx.Req.RequestURI, ctx.User.LowerName)
|
||||
return
|
||||
} else {
|
||||
ctx.Data["AddSSHKeySuccess"] = true
|
||||
|
@@ -6,6 +6,7 @@ package user
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/codegangsta/martini"
|
||||
"github.com/martini-contrib/render"
|
||||
@@ -14,6 +15,7 @@ import (
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
)
|
||||
|
||||
@@ -146,6 +148,7 @@ func SignUp(ctx *middleware.Context, form auth.RegisterForm) {
|
||||
return
|
||||
}
|
||||
|
||||
log.Trace("%s User created: %s", ctx.Req.RequestURI, strings.ToLower(form.UserName))
|
||||
ctx.Render.Redirect("/user/login")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user