mirror of https://github.com/gogs/gogs.git
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.gopull/4527/head
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…
Reference in New Issue