Skip to content

Commit

Permalink
keep login speed
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Nov 7, 2019
1 parent 1657a62 commit 7ab74eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 1 addition & 4 deletions models/login_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,7 @@ func LoginViaLDAP(user *User, login, password string, source *LoginSource, autoR
if len(source.LDAP().AdminFilter) > 0 {
user.IsAdmin = sr.IsAdmin
}
if err := UpdateUserCols(user, "full_name", "email", "is_admin"); err != nil {
return nil, err
}

go UpdateLdapUserAtLogin(user)
}

if !autoRegister {
Expand Down
7 changes: 7 additions & 0 deletions models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -1827,3 +1827,10 @@ func SyncExternalUsers() {
}
}
}

func UpdateLdapUserAtLogin(user *User) (err error) {
if err := UpdateUserCols(user, "full_name", "email", "is_admin"); err != nil {
return err
}
return nil
}

0 comments on commit 7ab74eb

Please sign in to comment.