diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-07-26 00:24:27 -0400 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-07-26 00:24:27 -0400 |
commit | 8dd07c0ddd99ae626a1ec8c06f75f27fed51269f (patch) | |
tree | 261d3c9911dabc58c1ac54e4e36b3dee24d2032b /routers/install.go | |
parent | 0a739cf9ac901f54484c34bba8322418dedb09b0 (diff) | |
download | gitea-8dd07c0ddd99ae626a1ec8c06f75f27fed51269f.tar.gz gitea-8dd07c0ddd99ae626a1ec8c06f75f27fed51269f.zip |
New UI merge in progress
Diffstat (limited to 'routers/install.go')
-rw-r--r-- | routers/install.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/routers/install.go b/routers/install.go index bb3c16eae4..516d11e4aa 100644 --- a/routers/install.go +++ b/routers/install.go @@ -11,8 +11,9 @@ import ( "path" "strings" + "github.com/Unknwon/com" "github.com/Unknwon/goconfig" - "github.com/go-martini/martini" + "github.com/Unknwon/macaron" "github.com/go-xorm/xorm" "github.com/gogits/gogs/models" @@ -33,12 +34,12 @@ const ( func checkRunMode() { switch setting.Cfg.MustValue("", "RUN_MODE") { case "prod": - martini.Env = martini.Prod + macaron.Env = macaron.PROD setting.ProdMode = true case "test": - martini.Env = martini.Test + macaron.Env = macaron.TEST } - log.Info("Run Mode: %s", strings.Title(martini.Env)) + log.Info("Run Mode: %s", strings.Title(macaron.Env)) } func NewServices() { @@ -59,7 +60,7 @@ func GlobalInit() { if setting.InstallLock { if err := models.NewEngine(); err != nil { - log.Fatal("Fail to initialize ORM engine: %v", err) + log.Fatal(4, "Fail to initialize ORM engine: %v", err) } models.HasEngine = true @@ -210,8 +211,8 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) { setting.Cfg.SetValue("mailer", "USER", form.SmtpEmail) setting.Cfg.SetValue("mailer", "PASSWD", form.SmtpPasswd) - setting.Cfg.SetValue("service", "REGISTER_EMAIL_CONFIRM", base.ToStr(form.RegisterConfirm == "on")) - setting.Cfg.SetValue("service", "ENABLE_NOTIFY_MAIL", base.ToStr(form.MailNotify == "on")) + setting.Cfg.SetValue("service", "REGISTER_EMAIL_CONFIRM", com.ToStr(form.RegisterConfirm == "on")) + setting.Cfg.SetValue("service", "ENABLE_NOTIFY_MAIL", com.ToStr(form.MailNotify == "on")) } setting.Cfg.SetValue("", "RUN_MODE", "prod") @@ -227,7 +228,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) { GlobalInit() // Create admin account. - if _, err := models.CreateUser(&models.User{Name: form.AdminName, Email: form.AdminEmail, Passwd: form.AdminPasswd, + if err := models.CreateUser(&models.User{Name: form.AdminName, Email: form.AdminEmail, Passwd: form.AdminPasswd, IsAdmin: true, IsActive: true}); err != nil { if err != models.ErrUserAlreadyExist { setting.InstallLock = false |