aboutsummaryrefslogtreecommitdiff
path: root/routers/install.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-29 14:35:54 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-29 14:35:54 +0800
commitf48fc24670b122df069149801459eb55a67045c7 (patch)
tree04a054e989341953072f854134a50d62f75993c8 /routers/install.go
parente085d7738a683785a5d7d7e3a33a0437c87c340b (diff)
parentd01820c125669367b7a585d767d5f11e73a701c2 (diff)
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'routers/install.go')
-rw-r--r--routers/install.go28
1 files changed, 24 insertions, 4 deletions
diff --git a/routers/install.go b/routers/install.go
index d7d5159e..b5c3a936 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -4,10 +4,30 @@
package routers
-import "github.com/gogits/gogs/modules/middleware"
+import (
+ "errors"
+
+ "github.com/gogits/gogs/models"
+ "github.com/gogits/gogs/modules/auth"
+ "github.com/gogits/gogs/modules/base"
+ "github.com/gogits/gogs/modules/middleware"
+)
+
+func Install(ctx *middleware.Context, form auth.InstallForm) {
+ if base.InstallLock {
+ ctx.Handle(404, "install.Install", errors.New("Installation is prohibited"))
+ return
+ }
-func Install(ctx *middleware.Context){
- ctx.Data["PageIsInstall"] = true
ctx.Data["Title"] = "Install"
- ctx.HTML(200,"install")
+ ctx.Data["DbCfg"] = models.DbCfg
+ ctx.Data["RepoRootPath"] = base.RepoRootPath
+ ctx.Data["RunUser"] = base.RunUser
+ ctx.Data["AppUrl"] = base.AppUrl
+ ctx.Data["PageIsInstall"] = true
+
+ if ctx.Req.Method == "GET" {
+ ctx.HTML(200, "install")
+ return
+ }
}