1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-14 14:14:25 +00:00

Apply DefaultUserIsRestricted in CreateUser

This commit is contained in:
Jimmy Praet 2022-04-01 19:26:49 +02:00
parent 7b4c3c7bb1
commit 9020faa3ce
3 changed files with 12 additions and 13 deletions

View File

@ -637,6 +637,7 @@ func CreateUser(u *User, overwriteDefault ...*CreateUserOverwriteOptions) (err e
u.EmailNotificationsPreference = setting.Admin.DefaultEmailNotification
u.MaxRepoCreation = -1
u.Theme = setting.UI.DefaultTheme
u.IsRestricted = u.IsRestricted || setting.Service.DefaultUserIsRestricted
// overwrite defaults if set
if len(overwriteDefault) != 0 && overwriteDefault[0] != nil {

View File

@ -511,7 +511,6 @@ func SignUpPost(ctx *context.Context) {
Email: form.Email,
Passwd: form.Password,
IsActive: !(setting.Service.RegisterEmailConfirm || setting.Service.RegisterManualConfirm),
IsRestricted: setting.Service.DefaultUserIsRestricted,
}
if !createAndHandleCreatedUser(ctx, tplSignUp, form, u, nil, false) {

View File

@ -874,7 +874,6 @@ func SignInOAuthCallback(ctx *context.Context) {
LoginType: auth.OAuth2,
LoginSource: authSource.ID,
LoginName: gothUser.UserID,
IsRestricted: setting.Service.DefaultUserIsRestricted,
}
setUserGroupClaims(authSource, u, &gothUser)