From d87ea87aee883b073ff198902c0439a19ff707e5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 19 Feb 2014 13:13:02 -0500 Subject: [PATCH] Add code of delete user --- routers/user/user.go | 8 ++++++++ web.go | 1 + 2 files changed, 9 insertions(+) diff --git a/routers/user/user.go b/routers/user/user.go index 24c22a4f440..35666012005 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -51,3 +51,11 @@ func SignUp(req *http.Request, r render.Render) { "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), + }) +} diff --git a/web.go b/web.go index f64b606383c..f0bad8abd2c 100644 --- a/web.go +++ b/web.go @@ -42,6 +42,7 @@ func runWeb(*cli.Context) { m.Get("/", routers.Dashboard) m.Get("/user/signin", user.SignIn) m.Any("/user/signup", user.SignUp) + m.Any("/user/delete", user.Delete) listenAddr := fmt.Sprintf("%s:%s", utils.Cfg.MustValue("server", "HTTP_ADDR"),