disable inviting new users to orgs if login form is disabled

This commit is contained in:
Dan Cech
2017-03-17 16:35:05 -04:00
parent 38cab50a0c
commit 737c29ec8c
6 changed files with 81 additions and 8 deletions
+4
View File
@@ -38,6 +38,10 @@ func AddOrgInvite(c *middleware.Context, inviteDto dtos.AddInviteForm) Response
if err != m.ErrUserNotFound {
return ApiError(500, "Failed to query db for existing user check", err)
}
if setting.DisableLoginForm {
return ApiError(401, "User could not be found", nil)
}
} else {
return inviteExistingUserToOrg(c, userQuery.Result, &inviteDto)
}