aboutsummaryrefslogtreecommitdiffstats
path: root/web.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-10 16:36:50 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-10 16:36:50 -0400
commit45462662e9bdb001f1cf3d4ca0e4d679757c7642 (patch)
treeeb5f3bfe24a423601ad27121c95427719cb16984 /web.go
parent459223cf01d19a6956d370fad9ab41d3a32233d0 (diff)
downloadgitea-45462662e9bdb001f1cf3d4ca0e4d679757c7642.tar.gz
gitea-45462662e9bdb001f1cf3d4ca0e4d679757c7642.zip
Add flash
Diffstat (limited to 'web.go')
-rw-r--r--web.go43
1 files changed, 24 insertions, 19 deletions
diff --git a/web.go b/web.go
index 962ad7445d..8af27038fe 100644
--- a/web.go
+++ b/web.go
@@ -83,8 +83,8 @@ func runWeb(*cli.Context) {
// Routers.
m.Get("/", ignSignIn, routers.Home)
- m.Get("/install", bindIgnErr(auth.InstallForm{}), routers.InstallRouter.Get)
- m.Post("/install", bindIgnErr(auth.InstallForm{}), routers.InstallRouter.Post)
+ m.Get("/install", bindIgnErr(auth.InstallForm{}), routers.Install)
+ m.Post("/install", bindIgnErr(auth.InstallForm{}), routers.InstallPost)
m.Get("/issues", reqSignIn, user.Issues)
m.Get("/pulls", reqSignIn, user.Pulls)
m.Get("/stars", reqSignIn, user.Stars)
@@ -98,33 +98,38 @@ func runWeb(*cli.Context) {
m.Get("/avatar/:hash", avt.ServeHTTP)
m.Group("/user", func(r martini.Router) {
- r.Any("/login", binding.BindIgnErr(auth.LogInForm{}), user.SignIn)
- r.Any("/login/github", user.SocialSignIn)
- r.Any("/sign_up", binding.BindIgnErr(auth.RegisterForm{}), user.SignUp)
- r.Any("/forget_password", user.ForgotPasswd)
- r.Any("/reset_password", user.ResetPasswd)
+ r.Get("/login", user.SignIn)
+ r.Post("/login", bindIgnErr(auth.LogInForm{}), user.SignInPost)
+ r.Get("/login/github", user.SocialSignIn)
+ r.Get("/sign_up", user.SignUp)
+ r.Post("/sign_up", bindIgnErr(auth.RegisterForm{}), user.SignUpPost)
+ r.Get("/forget_password", user.ForgotPasswd)
+ r.Post("/forget_password", user.ForgotPasswdPost)
+ r.Get("/reset_password", user.ResetPasswd)
+ r.Post("/reset_password", user.ResetPasswdPost)
}, reqSignOut)
m.Group("/user", func(r martini.Router) {
- r.Any("/logout", user.SignOut)
- r.Any("/delete", user.Delete)
- r.Any("/setting", binding.BindIgnErr(auth.UpdateProfileForm{}), user.Setting)
+ r.Get("/logout", user.SignOut)
+ r.Get("/delete", user.Delete)
+ r.Post("/delete", user.DeletePost)
+ r.Get("/setting", user.Setting)
+ r.Post("/setting", bindIgnErr(auth.UpdateProfileForm{}), user.SettingPost)
}, reqSignIn)
m.Group("/user", func(r martini.Router) {
r.Get("/feeds", binding.Bind(auth.FeedsForm{}), user.Feeds)
r.Get("/activate", user.Activate)
})
-
m.Group("/user/setting", func(r martini.Router) {
- r.Any("/password", binding.BindIgnErr(auth.UpdatePasswdForm{}), user.SettingPassword)
- r.Any("/ssh", binding.BindIgnErr(auth.AddSSHKeyForm{}), user.SettingSSHKeys)
+ r.Any("/password", bindIgnErr(auth.UpdatePasswdForm{}), user.SettingPassword)
+ r.Any("/ssh", bindIgnErr(auth.AddSSHKeyForm{}), user.SettingSSHKeys)
r.Any("/notification", user.SettingNotification)
r.Any("/security", user.SettingSecurity)
}, reqSignIn)
m.Get("/user/:username", ignSignIn, user.Profile)
- m.Any("/repo/create", reqSignIn, binding.BindIgnErr(auth.CreateRepoForm{}), repo.Create)
- m.Any("/repo/mirror", reqSignIn, binding.BindIgnErr(auth.CreateRepoForm{}), repo.Mirror)
+ m.Any("/repo/create", reqSignIn, bindIgnErr(auth.CreateRepoForm{}), repo.Create)
+ m.Any("/repo/mirror", reqSignIn, bindIgnErr(auth.CreateRepoForm{}), repo.Mirror)
adminReq := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true, AdminRequire: true})
@@ -135,8 +140,8 @@ func runWeb(*cli.Context) {
r.Get("/config", admin.Config)
}, adminReq)
m.Group("/admin/users", func(r martini.Router) {
- r.Any("/new", binding.BindIgnErr(auth.RegisterForm{}), admin.NewUser)
- r.Any("/:userid", binding.BindIgnErr(auth.AdminEditUserForm{}), admin.EditUser)
+ r.Any("/new", bindIgnErr(auth.RegisterForm{}), admin.NewUser)
+ r.Any("/:userid", bindIgnErr(auth.AdminEditUserForm{}), admin.EditUser)
r.Any("/:userid/delete", admin.DeleteUser)
}, adminReq)
@@ -148,8 +153,8 @@ func runWeb(*cli.Context) {
r.Post("/settings", repo.SettingPost)
r.Get("/settings", repo.Setting)
r.Get("/action/:action", repo.Action)
- r.Any("/issues/new", binding.BindIgnErr(auth.CreateIssueForm{}), repo.CreateIssue)
- r.Post("/issues/:index", binding.BindIgnErr(auth.CreateIssueForm{}), repo.UpdateIssue)
+ r.Any("/issues/new", bindIgnErr(auth.CreateIssueForm{}), repo.CreateIssue)
+ r.Post("/issues/:index", bindIgnErr(auth.CreateIssueForm{}), repo.UpdateIssue)
r.Post("/comment/:action", repo.Comment)
}, reqSignIn, middleware.RepoAssignment(true))