mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 15:01:56 +00:00
Fix build errors
This commit is contained in:
@@ -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()
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user