mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Merge pull request #221 from LD-Reborn/220-bug-users-view-loads-slowly-because-of-unneeded-ldap-properties
Fixed performance issue related to user model retrieval, cleaned up L…
This commit is contained in:
@@ -77,7 +77,7 @@ public class HomeController : Controller
|
||||
[HttpGet("Users")]
|
||||
public async Task<ActionResult> UsersAsync()
|
||||
{
|
||||
IEnumerable<UserModel> users = await _ldap.ListUsersAsync();
|
||||
IEnumerable<UserModel> users = await _ldap.ListUsersAsync([.. _ldap.UsersAttributes.Where(attr => attr != "jpegPhoto" && attr != "userPassword")]);
|
||||
List<UserTableViewModel> UserTableViewModels = [];
|
||||
foreach (UserModel user in users)
|
||||
{
|
||||
|
||||
@@ -77,10 +77,7 @@ public partial class LdapService : IDisposable
|
||||
|
||||
public async Task<IEnumerable<UserModel>> ListUsersAsync()
|
||||
{
|
||||
IEnumerable<Dictionary<string, string>> users = await ListObjectBy(UsersBaseDn, "", UsersAttributes);
|
||||
List<UserModel> models = [];
|
||||
users.ToList().ForEach(x => models.Add(new UserModel(x) {Uid = x["uid"]}));
|
||||
return models;
|
||||
return await ListUsersAsync(UsersAttributes);
|
||||
}
|
||||
|
||||
public async Task<MigrationModel> GetMigrationVersionAsync()
|
||||
|
||||
Reference in New Issue
Block a user