Simplified single org settings, now auto_assign_org, and auto_assign_org_role, new [users] config section, Closes #1585
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ func LoginView(c *middleware.Context) {
|
||||
settings := c.Data["Settings"].(map[string]interface{})
|
||||
settings["googleAuthEnabled"] = setting.OAuthService.Google
|
||||
settings["githubAuthEnabled"] = setting.OAuthService.GitHub
|
||||
settings["disableUserSignUp"] = setting.DisableUserSignUp
|
||||
settings["disableUserSignUp"] = !setting.AllowUserSignUp
|
||||
|
||||
// Check auto-login.
|
||||
uname := c.GetCookie(setting.CookieUserName)
|
||||
|
||||
@@ -56,7 +56,7 @@ func OAuthLogin(ctx *middleware.Context) {
|
||||
|
||||
// create account if missing
|
||||
if err == m.ErrUserNotFound {
|
||||
if setting.DisableUserSignUp {
|
||||
if !setting.AllowUserSignUp {
|
||||
ctx.Redirect(setting.AppSubUrl + "/login")
|
||||
return
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// POST /api/user/signup
|
||||
func SignUp(c *middleware.Context, cmd m.CreateUserCommand) {
|
||||
if setting.DisableUserSignUp {
|
||||
if !setting.AllowUserSignUp {
|
||||
c.JsonApiErr(401, "User signup is disabled", nil)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user