mirror of
https://github.com/go-gitea/gitea
synced 2024-11-24 14:12:44 +01:00
Add code of delete user
This commit is contained in:
parent
4b92a6c2df
commit
d87ea87aee
2 changed files with 9 additions and 0 deletions
|
@ -51,3 +51,11 @@ func SignUp(req *http.Request, r render.Render) {
|
||||||
"Title": fmt.Sprintf("%v", err),
|
"Title": fmt.Sprintf("%v", err),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Delete(r render.Render) {
|
||||||
|
u := &models.User{}
|
||||||
|
err := models.DeleteUser(u)
|
||||||
|
r.HTML(403, "status/403", map[string]interface{}{
|
||||||
|
"Title": fmt.Sprintf("%v", err),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
1
web.go
1
web.go
|
@ -42,6 +42,7 @@ func runWeb(*cli.Context) {
|
||||||
m.Get("/", routers.Dashboard)
|
m.Get("/", routers.Dashboard)
|
||||||
m.Get("/user/signin", user.SignIn)
|
m.Get("/user/signin", user.SignIn)
|
||||||
m.Any("/user/signup", user.SignUp)
|
m.Any("/user/signup", user.SignUp)
|
||||||
|
m.Any("/user/delete", user.Delete)
|
||||||
|
|
||||||
listenAddr := fmt.Sprintf("%s:%s",
|
listenAddr := fmt.Sprintf("%s:%s",
|
||||||
utils.Cfg.MustValue("server", "HTTP_ADDR"),
|
utils.Cfg.MustValue("server", "HTTP_ADDR"),
|
||||||
|
|
Loading…
Reference in a new issue