mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 18:34:06 +01:00
Apply DefaultUserIsRestricted in CreateUser
This commit is contained in:
parent
7b4c3c7bb1
commit
9020faa3ce
3 changed files with 12 additions and 13 deletions
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue