mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Implemented frontend Assets update button
This commit is contained in:
@@ -186,9 +186,18 @@ public partial class LdapService : IDisposable
|
||||
{
|
||||
IEnumerable<Dictionary<string, string>> devices = await ListObjectBy(AssetsBaseDn, "(objectClass=device)", AssetsAttributes);
|
||||
List<AssetModel> models = [];
|
||||
devices.ToList().ForEach(x => models.Add(new AssetModel(x) {Cn = x["cn"]}));
|
||||
devices.ToList().ForEach(x => models.Add(new AssetModel(x) { Cn = x["cn"] }));
|
||||
return models;
|
||||
}
|
||||
|
||||
public async Task<AssetModel> ListDeviceAsync(string Cn)
|
||||
{
|
||||
IEnumerable<Dictionary<string, string>> devices = await ListObjectBy(AssetsBaseDn, $"(objectClass=device)", AssetsAttributes);
|
||||
Dictionary<string, string> entry = devices.ToList().First(x => x.GetValueOrDefault("cn") != null && x["cn"] == Cn);
|
||||
AssetModel model = new(entry) { Cn = entry["cn"] };
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
public async Task CreateUser(string uid, LdapAttributeSet attributeSet)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user