Fix build errors

This commit is contained in:
anomny
2025-10-04 10:38:19 +02:00
parent e102d0048b
commit a34534eb62
2 changed files with 22 additions and 24 deletions

View File

@@ -66,19 +66,18 @@ public class GroupsController : Controller
{
description ??= JsonSerializer.Serialize(new GroupPermissions() {Permissions = []});
LdapAttributeSet attributeSet =
[
new LdapAttribute("objectClass", "posixGroup"),
new LdapAttribute("objectClass", "top"),
new LdapAttribute("cn", cn),
new LdapAttribute("gidNumber", gidNumber),
new LdapAttribute("description",
JsonSerializer.Serialize(
new GroupPermissions()
{
Permissions = [.. permissions]
})),
];
var attributeSet = new LdapAttributeSet();
attributeSet.Add(new LdapAttribute("objectClass", "posixGroup"));
attributeSet.Add(new LdapAttribute("objectClass", "top"));
attributeSet.Add(new LdapAttribute("cn", cn));
attributeSet.Add(new LdapAttribute("gidNumber", gidNumber));
attributeSet.Add(new LdapAttribute(
"description",
JsonSerializer.Serialize(new GroupPermissions()
{
Permissions = [.. permissions]
})));
await _ldap.CreateGroup(cn, attributeSet);
return true;
}

View File

@@ -74,17 +74,16 @@ public class UsersController : Controller
byte[] hashedPassword = SHA256.HashData(passwordBytes);
userPassword = "{SHA256}" + Convert.ToBase64String(hashedPassword);
}
LdapAttributeSet attributeSet =
[
new LdapAttribute("objectClass", "inetOrgPerson"),
new LdapAttribute("cn", cn),
new LdapAttribute("sn", sn),
new LdapAttribute("title", title),
new LdapAttribute("uid", uid),
new LdapAttribute("jpegPhoto", jpegPhoto),
new LdapAttribute("description", description),
new LdapAttribute("userPassword", userPassword)
];
LdapAttributeSet attributeSet = new LdapAttributeSet();
attributeSet.Add(new LdapAttribute("objectClass", "inetOrgPerson"));
attributeSet.Add(new LdapAttribute("cn", cn));
attributeSet.Add(new LdapAttribute("sn", sn));
attributeSet.Add(new LdapAttribute("title", title));
attributeSet.Add(new LdapAttribute("uid", uid));
attributeSet.Add(new LdapAttribute("jpegPhoto", jpegPhoto));
attributeSet.Add(new LdapAttribute("description", description));
attributeSet.Add(new LdapAttribute("userPassword", userPassword));
await _ldap.CreateUser(uid, attributeSet);
return true;
}