Browse Source

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
pull/4527/head
Jon Lundy 8 years ago committed by 无闻
parent
commit
1755025e7f
  1. 10
      models/login_source.go

10
models/login_source.go

@ -327,6 +327,16 @@ func LoginViaLDAP(user *User, login, password string, source *LoginSource, autoR
IsActive: true, IsActive: true,
IsAdmin: isAdmin, IsAdmin: isAdmin,
} }
ok, err := IsUserExist(0, user.Name)
if err != nil {
return user, err
}
if ok {
return user, UpdateUser(user)
}
return user, CreateUser(user) return user, CreateUser(user)
} }

Loading…
Cancel
Save