]> source.dussan.org Git - gitea.git/commitdiff
Set OpenID support on by default when installing new instance (#3010) (#3027)
authorLauris BH <lauris@nix.lv>
Wed, 29 Nov 2017 13:32:20 +0000 (15:32 +0200)
committerLunny Xiao <xiaolunwen@gmail.com>
Wed, 29 Nov 2017 13:32:20 +0000 (21:32 +0800)
modules/setting/setting.go
routers/install.go

index df80ebdb5744ec5f74125a4f9dcdc384eb40068a..d90776eb8672c1a8548e1a21c56665fdffa4914d 100644 (file)
@@ -1166,7 +1166,7 @@ func newService() {
        Service.NoReplyAddress = sec.Key("NO_REPLY_ADDRESS").MustString("noreply.example.org")
 
        sec = Cfg.Section("openid")
-       Service.EnableOpenIDSignIn = sec.Key("ENABLE_OPENID_SIGNIN").MustBool(false)
+       Service.EnableOpenIDSignIn = sec.Key("ENABLE_OPENID_SIGNIN").MustBool(!InstallLock)
        Service.EnableOpenIDSignUp = sec.Key("ENABLE_OPENID_SIGNUP").MustBool(!Service.DisableRegistration && Service.EnableOpenIDSignIn)
        pats := sec.Key("WHITELISTED_URIS").Strings(" ")
        if len(pats) != 0 {
index 427bb960f2ac822811bcb91287e7bcd7b6b9fbc4..e832f98739895500cc442fbe9384bdf1e8c77c03 100644 (file)
@@ -108,8 +108,8 @@ func Install(ctx *context.Context) {
        form.OfflineMode = setting.OfflineMode
        form.DisableGravatar = setting.DisableGravatar
        form.EnableFederatedAvatar = setting.EnableFederatedAvatar
-       form.EnableOpenIDSignIn = true
-       form.EnableOpenIDSignUp = true
+       form.EnableOpenIDSignIn = setting.Service.EnableOpenIDSignIn
+       form.EnableOpenIDSignUp = setting.Service.EnableOpenIDSignUp
        form.DisableRegistration = setting.Service.DisableRegistration
        form.EnableCaptcha = setting.Service.EnableCaptcha
        form.RequireSignInView = setting.Service.RequireSignInView