mirror of
https://github.com/gogs/gogs.git
synced 2025-07-09 12:10:55 +00:00
models/login_source: add check for user for create/update on LDAP (#4405)
* Add check for user for create/update * Update login_source.go * Update login_source.go
This commit is contained in:
parent
1a4ba4c390
commit
1755025e7f
@ -327,6 +327,16 @@ func LoginViaLDAP(user *User, login, password string, source *LoginSource, autoR
|
||||
IsActive: true,
|
||||
IsAdmin: isAdmin,
|
||||
}
|
||||
|
||||
ok, err := IsUserExist(0, user.Name)
|
||||
if err != nil {
|
||||
return user, err
|
||||
}
|
||||
|
||||
if ok {
|
||||
return user, UpdateUser(user)
|
||||
}
|
||||
|
||||
return user, CreateUser(user)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user