diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-28 07:26:22 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-28 07:26:22 -0400 |
commit | 0fd754bbe0dab966ad3070dc24f9583c67c84513 (patch) | |
tree | e9386c5a5f89e3db23b8273a7ca2b14804eef524 /routers/install.go | |
parent | 5344a0300383c4921e4a5810dff58c7686412f0c (diff) | |
download | gitea-0fd754bbe0dab966ad3070dc24f9583c67c84513.tar.gz gitea-0fd754bbe0dab966ad3070dc24f9583c67c84513.zip |
Working on install page
Diffstat (limited to 'routers/install.go')
-rw-r--r-- | routers/install.go | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/routers/install.go b/routers/install.go index d7d5159efc..b44b89034e 100644 --- a/routers/install.go +++ b/routers/install.go @@ -4,10 +4,28 @@ package routers -import "github.com/gogits/gogs/modules/middleware" +import ( + "errors" + + "github.com/gogits/gogs/models" + "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/middleware" +) + +func Install(ctx *middleware.Context) { + 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["PageIsInstall"] = true + + if ctx.Req.Method == "GET" { + ctx.HTML(200, "install") + return + } } |