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 = []});
|
description ??= JsonSerializer.Serialize(new GroupPermissions() {Permissions = []});
|
||||||
|
|
||||||
LdapAttributeSet attributeSet =
|
var attributeSet = new LdapAttributeSet();
|
||||||
[
|
attributeSet.Add(new LdapAttribute("objectClass", "posixGroup"));
|
||||||
new LdapAttribute("objectClass", "posixGroup"),
|
attributeSet.Add(new LdapAttribute("objectClass", "top"));
|
||||||
new LdapAttribute("objectClass", "top"),
|
attributeSet.Add(new LdapAttribute("cn", cn));
|
||||||
new LdapAttribute("cn", cn),
|
attributeSet.Add(new LdapAttribute("gidNumber", gidNumber));
|
||||||
new LdapAttribute("gidNumber", gidNumber),
|
attributeSet.Add(new LdapAttribute(
|
||||||
new LdapAttribute("description",
|
"description",
|
||||||
JsonSerializer.Serialize(
|
JsonSerializer.Serialize(new GroupPermissions()
|
||||||
new GroupPermissions()
|
|
||||||
{
|
{
|
||||||
Permissions = [.. permissions]
|
Permissions = [.. permissions]
|
||||||
})),
|
})));
|
||||||
];
|
|
||||||
await _ldap.CreateGroup(cn, attributeSet);
|
await _ldap.CreateGroup(cn, attributeSet);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,17 +74,16 @@ public class UsersController : Controller
|
|||||||
byte[] hashedPassword = SHA256.HashData(passwordBytes);
|
byte[] hashedPassword = SHA256.HashData(passwordBytes);
|
||||||
userPassword = "{SHA256}" + Convert.ToBase64String(hashedPassword);
|
userPassword = "{SHA256}" + Convert.ToBase64String(hashedPassword);
|
||||||
}
|
}
|
||||||
LdapAttributeSet attributeSet =
|
|
||||||
[
|
LdapAttributeSet attributeSet = new LdapAttributeSet();
|
||||||
new LdapAttribute("objectClass", "inetOrgPerson"),
|
attributeSet.Add(new LdapAttribute("objectClass", "inetOrgPerson"));
|
||||||
new LdapAttribute("cn", cn),
|
attributeSet.Add(new LdapAttribute("cn", cn));
|
||||||
new LdapAttribute("sn", sn),
|
attributeSet.Add(new LdapAttribute("sn", sn));
|
||||||
new LdapAttribute("title", title),
|
attributeSet.Add(new LdapAttribute("title", title));
|
||||||
new LdapAttribute("uid", uid),
|
attributeSet.Add(new LdapAttribute("uid", uid));
|
||||||
new LdapAttribute("jpegPhoto", jpegPhoto),
|
attributeSet.Add(new LdapAttribute("jpegPhoto", jpegPhoto));
|
||||||
new LdapAttribute("description", description),
|
attributeSet.Add(new LdapAttribute("description", description));
|
||||||
new LdapAttribute("userPassword", userPassword)
|
attributeSet.Add(new LdapAttribute("userPassword", userPassword));
|
||||||
];
|
|
||||||
await _ldap.CreateUser(uid, attributeSet);
|
await _ldap.CreateUser(uid, attributeSet);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user